Hi, I can't get your Treeview ContextMenu to work under prometheus, have tried another thread for XML loading so now using straight code (another thread has working example using declarative control-side contextmenus, so at least I know that works!).
Using similar code to the help file, can see the population code runs fine through debug, however on the page there is nothing on a right-click (although it looks like they're in the javascript).
Why does
seem to be ignored? I tried swapping in "UGM_UserGroup" in case of helpfile error but still same.
Using similar code to the help file, can see the population code runs fine through debug, however on the page there is nothing on a right-click (although it looks like they're in the javascript).
| Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load |
| If Not Page.IsPostBack Then |
| cntxMenuUserGroup = New RadTreeViewContextMenu() |
| cntxMenuUserGroup.ID = "UGM_UserGroup" |
| Dim menuItem1 As New RadMenuItem() |
| menuItem1.Text = "Remove User From UserGroup" |
| menuItem1.Value = "UGM_User_Remove" |
| cntxMenuUserGroup.Items.Add(menuItem1) |
| Dim menuItem2 As New RadMenuItem() |
| menuItem2.Text = "Add User To UserGroup" |
| menuItem2.Value = "UGM_User_Add" |
| cntxMenuUserGroup.Items.Add(menuItem2) |
| RadTree1.ContextMenus.Add(cntxMenuUserGroup) |
| BuildTree() |
| End If |
| End Sub |
| Public Sub BuildTree() |
| dbCon.Open() |
| Dim adapter As New SqlDataAdapter("SELECT blah blah", dbCon) |
| Dim ds As New DataSet |
| adapter.Fill(ds) |
| Dim row As DataRow |
| For Each row In ds.Tables(0).Rows |
| Dim node As New Telerik.Web.UI.RadTreeNode |
| node.Text = CStr(row("UDesc")) |
| node.Value = CStr(row("UVal")) |
| node.ContextMenuID = "cntxMenuUserGroup" |
| RadTree1.Nodes.Add(node) |
| If row("NumRecs") > 0 Then |
| node.ExpandMode = Telerik.Web.UI.TreeNodeExpandMode.ServerSide |
| Else |
| node.ExpandMode = Telerik.Web.UI.TreeNodeExpandMode.ClientSide |
| End If |
| Next row |
| dbCon.Close() |
| End Sub |
Why does
| node.ContextMenuID = "cntxMenuUserGroup" |