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

Selection

3 Answers 96 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 28 Feb 2011, 08:13 PM
How do I get the clientside selected data key?  Only thing I can find is DisplayIndex....and not sure if that's what I want (does the display index change for an item if it's collapsed and thus hidden?)

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 01 Mar 2011, 02:22 PM
Hello Steve,

As of current, the RadTreeList client-side API does not expose the DataKeyValue, so it cannot be accessed directly. A possible way would be, if you have a column displaying this value, to get hold of the HTML element of the selected item and access the textContent of the cell in question, similar to:

function itemSelect(sender, eventArgs) { 
    var item = eventArgs.get_item(); 
    alert(item.get_element().cells[3].textContent); 
}

This, however, may be hard to use, having in mind that the expand collapse buttons also take up cells.

Another thing you could try would be to register on the client the needed values from the ItemDataBound event of the RadTreeList control.

Regards,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Chris
Top achievements
Rank 1
answered on 09 Jun 2011, 08:19 PM
When will this be added to this control?  Your other controls have this already.

"Another thing you could try would be to register on the client the needed values from the ItemDataBound event of the RadTreeList control."

What do you mean by this do you have an example?

We are trying to implement a client side row click that opens a new window passing some parameters to the url of the new window based on the row that is selected.
0
Iana Tsolova
Telerik team
answered on 13 Jun 2011, 10:34 AM
Hello Chris,

We are enhancing the RadTreeList client-side API now and after the Q2 2011 release you would be able to use a built-in methods to achieve your goal.

Kind regards,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TreeList
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Tsvetina
Telerik team
Chris
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or