views:

204

answers:

1

Hi,

Currently I am using a sortable listview Which is bind to DataTable, I have a Serial number column which is auto incremented and displayed, Our requirement is when we sort other columns this column shall remain constant and show row numbers in series as in Excel.

I am planning to have a stack panel beside listview and adding Textboxes to stackpanel dynamically and removing serial number column from listview. please suggest me if there is any better way to do.

Thanks in advance.

Additional Info: Following Code is used to augment listview to provide sorting http://marlongrech.wordpress.com/2008/04/20/part1-avaloncontrolslibrary-datagridview/

A: 

Use a multi binding in your column to get the index of the current item. I liked this question so much i did a little project to demonstrate. there are probably better/other ways, but then again there always is :)

From this Site(where i post my test projects) download ListViewWithRowNumbers.zip

enjoy!

Aran Mulholland
Thanks a lot, I have downloaded project from your site, I shall checkout and get back to you in case of any issues, Again Thanks a ton.
Nadeem
Hi, I tried to incorporate your solution using following DataGrid form Microsoft http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-datagrid-feature-walkthrough.aspx But I am unable to bind it, could you please help me.
Nadeem