Hi,
I am looking for a way to extract the row number of a DataBoundListBox item. Is this possible?
Thanks.
Morten
1 Answer, 1 is accepted
0
Todor
Telerik team
answered on 18 Jan 2012, 01:16 PM
Hi Morten,
Thank you for your writing,
The rows in the RadDataBoundListBox are its items, and if I understand right, you need to get the index of a specific item in the source collection of the list box. If that is the case, then you can just use the IndexOf method of your collection and pass the required data item, which is actually the Content property of the associated ListBoxItem, as a parameter:
objectdataItem = myListBoxItem.Content;
intindex = mySourceCollection.IndexOf(dataItem);
I hope this helps. If this is not your case, don't hesitate to write us back.
Kind regards,
Todor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>