I want to add root node to self referenced database binded RadTree View.
RadContextMenu contextMenu = new RadContextMenu();
RadMenuItem addRootNodeItem = new RadMenuItem("New Node");
addRootNodeItem.Click += addRootNodeItem_Click;
contextMenu.Items.Add(addRootNodeItem);
radTreeView1.RadContextMenu = contextMenu;
void addRootNodeItem_Click(object sender, EventArgs e)
{
RadTreeNode RootNode = new RadTreeNode("New Node");
radTreeView1.Nodes.Add(RootNode);
I tried above code but which returns error Object reference not set to an instant of of an object.
Any other method to do this?
RadContextMenu contextMenu = new RadContextMenu();
RadMenuItem addRootNodeItem = new RadMenuItem("New Node");
addRootNodeItem.Click += addRootNodeItem_Click;
contextMenu.Items.Add(addRootNodeItem);
radTreeView1.RadContextMenu = contextMenu;
void addRootNodeItem_Click(object sender, EventArgs e)
{
RadTreeNode RootNode = new RadTreeNode("New Node");
radTreeView1.Nodes.Add(RootNode);
I tried above code but which returns error Object reference not set to an instant of of an object.
Any other method to do this?