Working with a Context Menu

2 posts, 0 answers
  1. Chris
    Chris avatar
    28 posts
    Member since:
    Jun 2012

    Posted 16 Sep 2011 Link to this post


    Very new to the RAD controls so please bear with me as I have moved over from Infragistics and CSOM is totally different.
    I have implemented a context menu using the RadContextMenu and so far so good.  However I can't work out how to access the data for the selected row client side.

    What I am trying to do is to get a value from a cell in the row clicked on when the context menu was invoked.  I have tried :-

    var commandName = args.get_item().get_text();
    if (commandName == "Properties")
    // Get the row selected in the tree
    var treeList = $find("<%= componentTree.ClientID %>");
    var row = treeList.get_selectedItems()[0]; 
    var componentID = treelist.getCellByColumnUniqueName(row, 'EmployeeID');

    // ...amd from the row get the component id"./componentproperties.aspx?componentid=" + componentID + "&src=compview"); 


    But this does not work - reading a bit further I don't think that the get_selectedItems is returning the selected rows which is a bit of a flaw in my understanding of this.  Any advice please on how to get the value of  call from the selected row?
  2. Mira
    Mira avatar
    1124 posts

    Posted 21 Sep 2011 Link to this post

    Hello Chris,

    Please examine the Integration with RadContextMenu demo to see how the desired functionality can be implemented.
    The get_item() property of the event arguments of the OnItemContextMenu event is the right-clicked TreeListDataItem object.

    I hope this helps.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top