Version

BeforeNoteEdit Event

Fired before a Note object is edited via the user interface.
Syntax
'Declaration
 
Public Event BeforeNoteEdit As BeforeNoteEditEventHandler
public event BeforeNoteEditEventHandler BeforeNoteEdit
Event Data

The event handler receives an argument of type BeforeNoteEditEventArgs containing data related to this event. The following BeforeNoteEditEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
Note Returns the note that is about to be edited
Remarks

The BeforeNoteEdit event is a cancelable event. If the event is canceled, the corresponding Note object's in-place editor will not appear, and as such the AfterNoteEdit event does not fire.

Example
This example demonstrates how to use the BeforeNoteEditEventArgs class' properties to only allow editing of Notes that fall on weekend days.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Private Sub UltraMonthViewSingle1_BeforeNoteEdit(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinSchedule.BeforeNoteEditEventArgs) Handles ultraMonthViewSingle.BeforeNoteEdit

    '----------------------------------------------------------------------------------------------------
    '	Description
    '	BeforeNoteEdit
    '
    '	Fires before a Note's description is edited via the control's UI.
    '	If the event is canceled, the Note will not allow editing, and the AfterNoteEdit
    '	event does not fire.
    '
    '----------------------------------------------------------------------------------------------------

    '	Get the day of the week on which the Note falls
    Dim dow As System.DayOfWeek = e.Note.Date.DayOfWeek

    '	If the Note falls on any other day than Saturday or Sunday,
    '	don't allow the edit
    If dow <> System.DayOfWeek.Saturday And dow <> System.DayOfWeek.Sunday Then
        MessageBox.Show("You do not have the appropriate permissions to edit this Note.", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Error)
        e.Cancel = True
        Return
    End If

End Sub
private void ultraMonthViewSingle1_BeforeNoteEdit(object sender, Infragistics.Win.UltraWinSchedule.BeforeNoteEditEventArgs e)
{
	//----------------------------------------------------------------------------------------------------
	//	Description
	//	BeforeNoteEdit
	//
	//	Fires before a Note's description is edited via the control's UI.
	//	If the event is canceled, the Note will not allow editing, and the AfterNoteEdit
	//	event does not fire.
	//
	//----------------------------------------------------------------------------------------------------

	//	Get the day of the week on which the Note falls
	System.DayOfWeek dow = e.Note.Date.DayOfWeek;

	//	If the Note falls on any other day than Saturday or Sunday,
	//	don't allow the edit
	if ( dow != System.DayOfWeek.Saturday && dow != System.DayOfWeek.Sunday )
	{
		MessageBox.Show( "You do not have the appropriate permissions to edit this Note.", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Error );
		e.Cancel = true;
		return;
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also