I am trying to prevent the editing of a certain node with this event handler:
It appears that I am missing something because the node text is still editable and this exception is thrown:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.RadTreeViewElement.BeginEdit()
at Telerik.WinControls.UI.RadTreeViewElement.mouseUpTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any suggestions?
private
void
radTreeView_Editing(
object
sender, TreeNodeEditingEventArgs e)
{
if
(e.Node.Text ==
"abc"
)
{
e.Node.CancelEdit();
}
}
It appears that I am missing something because the node text is still editable and this exception is thrown:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.RadTreeViewElement.BeginEdit()
at Telerik.WinControls.UI.RadTreeViewElement.mouseUpTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any suggestions?