Hello, I am trying to add row numbers to my data. I have used the method outlined in this post, but there are some issues with that approach:
In general, it would be great to see a more straightforward way to have row numbering. It would be a very useful feature to have!
Thanks,
Pavel
Hello Pavel,
I am glad you were able to come up with a solution. I am not quite sure when you are calculating the row number but if you are determining it in the converter, a better option may to calculate the row numbers originally and add another field to underlying object to hold the “index” and then bind to this field into display the row number.
Please let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hello Valerie,
Thanks for your reply and sample!
The solution for assigning a minimum width to the HeaderPrefixArea aligned everything well.
In order to determine the cumulative row number, I calculate the total recursively for each row.
This solution is very inefficient but my datasets are relatively small so this is acceptable for me.
Thanks again,
One suggestion I have for the row numbering to handle the hierarchy would be to display the row number for each level separated by dashed since there is no easy way to calculate the row number for child data with the entire collection.
Also for aligning the headers you can add a minimum width to the HeaderPrefixArea to match the minimum width of the record selector.
Please see attached sample.
Let me know if you have any questions.