WPF 4 DataGrid: Getting the Row Number into the RowHeader
I am looking to get the row number into the RowHeader of the WPF 4 DataGrid so it has an Excel-like column for the row numbers of the DataGrid. The solution I've seen out there on the web suggests adding an index field to the business objects. This isn't really an option because the DataGrid will be getting resorted a lot and we don't want to have to keep track of changing these index fields constantly. Thanks a lot One way is to add them in the LoadingRow event for the DataGrid . <DataGrid Name="DataGrid" LoadingRow="DataGrid_LoadingRow" ... /> void DataGrid_LoadingRow(object sender,