Hi,
I want to show the user how many rows there are in the first band excluding the template row and the flter row. Which property will give me the exact number?
In addition, I want to show "X rows out of Y" when a filter is applied and only X rows are being shown.
What is the event that I should listen to in order to know when the rows count has been changed?
Thanks
I also want to show "X rows out of Y" when a filter is applied and only X rows are being shown. But I also need to reflect the changed counts when I add / delete rows in my underlying datasource. Is there an event (or events) that I can listen on to know when either Rows.Count or Rows.FilteredInRowCount change in this case?
Okay. It's sometimes hard for me to keep track. My guess is that the filtering is done lazily, but accessing the FilteredInRowCount probably forces it to update, so it's okay.
Thanks Mike,
I used the InitializeLayout and AfterRowFilterChanged events to know the rows count, and it worked perfectly. I didn't see any lazy load behavior even with 10000 rows.
jct said:I want to show the user how many rows there are in the first band excluding the template row and the flter row. Which property will give me the exact number?
grid.Rows.Count
jct said:In addition, I want to show "X rows out of Y" when a filter is applied and only X rows are being shown.
grid.Rows.FilteredInRowCount
jct said:What is the event that I should listen to in order to know when the rows count has been changed?
This is a little tricky. By default, the grid does the filtering lazily. Try using the AfterRowFilterChanged event. If you find that the numbers you are getting in this event are not correct, then it must be because the filters have changed, but the rows haven't actually been filtered yet. If that's the case, then you will need to force the filtering to be performed synchronously. To do that, you have the BeforeRowFilterChanged event and set e.ProcessMode to Synchronous