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

2 posts, 0 answers
  1. bluetea55z
    bluetea55z avatar
    3 posts
    Member since:
    May 2014

    Posted 23 Sep 2014 Link to this post

    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.
  2. bluetea55z
    bluetea55z avatar
    3 posts
    Member since:
    May 2014

    Posted 23 Sep 2014 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top