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

Display RadListItem Index in DataTemplate

1 Answer 85 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Darryl
Top achievements
Rank 1
Darryl asked on 15 Feb 2013, 08:25 PM
I have a need to display the list item index + 1 in the list item data template.  I have created and converter for the index value, but I cannot seem to get the code to bind to the index.  any examples or suggestions on what property to look at would be great.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Darryl
Top achievements
Rank 1
answered on 15 Feb 2013, 08:51 PM
Never mind I figured it out.

<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=telerik:RadListBoxItem}, Converter={StaticResource rowNumberConverter}, StringFormat=' {0}) '}" Grid.Row="0" Grid.Column="0" Margin="2,5,0,0" />
Tags
ListBox
Asked by
Darryl
Top achievements
Rank 1
Answers by
Darryl
Top achievements
Rank 1
Share this question
or