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
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:
functionitemSelect(sender, eventArgs) {
varitem = 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!
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.