WPF 4 DataGrid: Getting the Row Number into the RowHeader

前端 未结 5 1925
日久生厌
日久生厌 2020-12-02 19:02

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 se

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 19:42

    LoadingRowEvent is triggered by this:

    ICollectionView view = CollectionViewSource.GetDefaultView(_dataGrid.ItemsSource);
    view.Refresh();
    

提交回复
热议问题