When I insert rows in the DataGrid, the order of the row numbers is wrong #9667
-
When I insert rows in the DataGrid, the order of the row numbers is wrong, I want to ask how to set the row number of a given row. I can be in the WPF: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi @ApaulMyLittleAirport maybe you can just create a Style for DataGridRow where you bind your item number (can also be a converter) to RowHeader? |
Beta Was this translation helpful? Give feedback.
-
You need to use LoadingRow event to handle this event. This way is times more reliable than having ContainerFromIndex API (which still is nice to have but won't solve your task properly). The problem is that rows are recycled, and you can handle recycling with LoadingRow and UnloadingRow events. |
Beta Was this translation helpful? Give feedback.
Hi @ApaulMyLittleAirport maybe you can just create a Style for DataGridRow where you bind your item number (can also be a converter) to RowHeader?