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

How SelectedItem Works

1 Answer 45 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 31 Oct 2014, 03:00 PM
I have 3 items in a DataBoundListBox in a datatemplate stack panel

 <Button x:Name="myButton"  />
<TextBlock x:Name="myTxt" />
<TextBlock x:Name="myTxt2" />

How do I get the value of, for example the myTxt2 text block of the selected item?

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 03 Nov 2014, 06:01 PM
Hello Michael,

Thank you for contacting us.

If you bind the TextBlock.Text property to a property from your data class, then using the SelectionChanged event, you can get the selected data item and the property that you are interested in. I have attached a sample project for demonstration.

I hope this helps.  

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DataBoundListBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or