Posted 26 July 2018, 5:46 am EST
Hi,
I can observe that adding FilterRow in TopRows collection increases DataGrid.Rows.Count. However, I doubt whether its possible to prevent counting FilterRow in grid’s Rows collection. One way you can circumvent this behavior is subtract the TopRows count while calculating the row index, as follows:
private void Grid_LoadedRowPresenter(object sender, C1.WPF.DataGrid.DataGridRowEventArgs e)
{
e.Row.Presenter.PreviewMouseLeftButtonUp += Presenter_PreviewMouseLeftButtonUp;
}
private void Presenter_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
[b] int rowIndex = ((C1.WPF.DataGrid.DataGridRowPresenter)sender).Row.Index - grid.TopRows.Count;[/b]
MessageBox.Show($"{rowIndex}");
e.Handled = true;
}
```Would this workaround be good enough for you?
Let me know, if you need any help further.
Thanks,
Ruchir