This is a migrated thread and some comments may be shown as answers.

RadTreeList w/ RadContextMenu (how do I get the Primary Key and ParentID of the selected node?)

1 Answer 31 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
bluetea55z
Top achievements
Rank 1
bluetea55z asked on 23 Sep 2014, 01:40 PM
I am using a RadTreeList control to display a bunch of items. I added a RadContextMenu to the page and set the OnItemClick event so I can use it in the code behind to set the URL of my RadWindow based on Insert and Edit. Then I open a radwindow using that url.


It looks exactly like the one in this demo

protected void rcMenu_ItemClick(object sender, RadMenuEventArgs e)
        {
            switch (e.Item.Value)
            {
                case "Insert":
                    url = "~/Admin/ManageItemsDialog.aspx?ID="
                    break;
                case "Edit":
                    url = "~/Admin/ManageItemsDialog.aspx?ID="
                    break;
            }
    }


In here I am trying to retrieve the ID and the ParentID of the selected item from the tree list. The ultimate goal is to open a RadWindow passing the ID and ParentID through the URL.

1 Answer, 1 is accepted

Sort by
0
bluetea55z
Top achievements
Rank 1
answered on 24 Sep 2014, 02:20 AM
I completely forgot I can just access my RadTreeListControl right in my rcMenu_ItemClick function and just do object ItemID=RadTreeList1.SelectedItems[0]. I am so used to doing complex things that I didn't realize it was right in front of me all along.
Tags
TreeList
Asked by
bluetea55z
Top achievements
Rank 1
Answers by
bluetea55z
Top achievements
Rank 1
Share this question
or