0

I have a such DataGrid

add

as you can see on screenshot I have a column Path to clip folder and below 3 rows, I would like to add at the left row numbers (like 1, 2, 3) for each row.

I found this solution

https://stackoverflow.com/a/9581709/5709159

But as far as I understand it will add numbers like hardcode, and if I delete (for example) row 2 I will see row numbers like 1 and 3...

Question is - is there a way that DataGrid numerate each row automatically?

Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
  • Linked question is `WinForms` related, which platform did you target? And share your code as well, please – Pavel Anikhouski Jan 26 '20 at 08:44
  • __Do not__ call a `DataGridView`a `GridView` or a `DataGrid` and vice versa!! This is wrong and confusing as those are different controls. - What are you targetting: Winforms, WPF, ASP..? YOU should __always__ TAG your questions correctly so one can see it on the questions page! - Winforms: You could call the numbering function on each rowadded or -removed event. – TaW Jan 26 '20 at 08:46

0 Answers0