Hello,
We are using Telerik Controls Version 2009.2.826.20 in our application and we are experiencing difficulties with RAD TreeView Node in the Context Menu Item.
Below is the set of RAD Controls we are using in the Application:
When we run the application, we are able to expand or collapse the Nodes. When the User right click a Node and select an item from the Context Menu, the event for the Context menu throws Object Reference Error. Sometimes it works and some times it doesnt work.
Why is the behavior as such? Can you help us to resolve this issue?
Below is the Code we have in our application for the Context Menu Item Event:
(We are accessing the node using e.Node and if the e.Node is present it works. In so many cases e.Node is becoming NULL and this is giving us the error Object Reference not set to an instance of an Object)
(The application works if we use the button from the ToolBar. Because in ToolBar event, we are accessing the Node using SelectedNode property and that works)
Protected Sub RdTViewPerspective_ContextMenuItemClick(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.RadTreeViewContextMenuEventArgs) Handles RdTViewPerspective.ContextMenuItemClick
Try
Select Case e.MenuItem.Value.ToUpper()
Case "SAP_INFO"
HideAllPanels()
DisplayGeneralInformation(e.Node)
DisplaySAPInfoPanel(e.Node)
ReSetToolBarButtons(e.Node)
Case Else
'Nothing to do.
End Select
Catch ex As Exception
log.Info(ex.Message.ToString())
Response.Redirect("CustomError.aspx?Msg=" + Server.UrlEncode(ex.Message.ToString()) + "&ErrorSource=" + Server.UrlEncode(ex.Source.Replace(Environment.NewLine, "-----><BR>").ToString()) + "&ErrorStack=" + Server.UrlEncode(ex.StackTrace.ToString()), False)
End Try
End Sub
Thanks
Sri K Gamini.
We are using Telerik Controls Version 2009.2.826.20 in our application and we are experiencing difficulties with RAD TreeView Node in the Context Menu Item.
Below is the set of RAD Controls we are using in the Application:
- Toolbar control. (This renders the functioanlity very fine)
- RAD Splitter Control.
- Left Pane we got RAD TreeView Control. (Implement Load on Demand using Page Behind Method)
- Right Pane we got sub Panels using DIV Controls. We are show/hide the Div's depending on the items selected in the Context Menu of the Tree View Control.
When we run the application, we are able to expand or collapse the Nodes. When the User right click a Node and select an item from the Context Menu, the event for the Context menu throws Object Reference Error. Sometimes it works and some times it doesnt work.
Why is the behavior as such? Can you help us to resolve this issue?
Below is the Code we have in our application for the Context Menu Item Event:
(We are accessing the node using e.Node and if the e.Node is present it works. In so many cases e.Node is becoming NULL and this is giving us the error Object Reference not set to an instance of an Object)
(The application works if we use the button from the ToolBar. Because in ToolBar event, we are accessing the Node using SelectedNode property and that works)
Protected Sub RdTViewPerspective_ContextMenuItemClick(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.RadTreeViewContextMenuEventArgs) Handles RdTViewPerspective.ContextMenuItemClick
Try
Select Case e.MenuItem.Value.ToUpper()
Case "SAP_INFO"
HideAllPanels()
DisplayGeneralInformation(e.Node)
DisplaySAPInfoPanel(e.Node)
ReSetToolBarButtons(e.Node)
Case Else
'Nothing to do.
End Select
Catch ex As Exception
log.Info(ex.Message.ToString())
Response.Redirect("CustomError.aspx?Msg=" + Server.UrlEncode(ex.Message.ToString()) + "&ErrorSource=" + Server.UrlEncode(ex.Source.Replace(Environment.NewLine, "-----><BR>").ToString()) + "&ErrorStack=" + Server.UrlEncode(ex.StackTrace.ToString()), False)
End Try
End Sub
Thanks
Sri K Gamini.