Quantcast
Viewing all articles
Browse latest Browse all 18858

How to enumerate a listview using binding

Hello. I have a listview like this

<ScrollViewer Grid.Column="3" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" FontSize="12"><ListView Name="ResultDetails" MinWidth="200"><ListView.ItemTemplate><DataTemplate><StackPanel><TextBlock Text="{Binding Path=StartPoint}"/><TextBlock Text="{Binding Path=FunctionValue}"/></StackPanel></DataTemplate></ListView.ItemTemplate></ListView></ScrollViewer>

this bind is oneway - from collection to view.

now i want to enumerate rows, so there's 2 ways

1) Create a new class == old class + field for counter and write like this

<StackPanel><TextBlock Text="{Binding Path=Counter}"/><TextBlock Text="{Binding Path=StartPoint}"/><TextBlock Text="{Binding Path=FunctionValue}"/></StackPanel>

2) ???

So first alternative is undesirable, and second i don't have.




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>