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
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
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.
There's no event in the grid for when rows are added or removed from the underlying data source. It's the responsilbiity of the data source to raise notifications for this.
InitializeRow will fire in the grid when a new row is added, but it will also fire for many other things, so that's not a very efficient event to use. You could try using PropertyChanged, but I don't know if this firs specifically for the Count property on the rows collection. I suspect it does not.
Hey guys,
I'm also tryint to display a row count in the form of x of y
I'm using the Grid.Rows.FilteredInRowCount property for the value of "y" (number of rows)
how do I get the index of the active row relative to the filtered list of rows?
Example: If I have 1000 rows and I filter the list to 10, clicking on the row number 5 the Grid.ActiveRow.Index property shows 756, which is the index of the row relative to the datasource list.
thanks !
Did you try VisibleIndex?
Hey thanks !, it's almost what I need, the only problem with this property is that it also counts the filter row and the add-new row.
Since the users have the ability to show/hide the filter row and set the location of the add-new row, I will need to add some code to check for those settings, and decrease the VisibleIndex if one of those rows is visible.
THANKS !
Raise an old topic ... My list contains 10 081 record, but in the event AfterRowFilterChanged my variable is equal to 1000:
GVOrdersInput.Rows.FilteredInRowCount = 10 000GVOrdersInput.Rows.Count = 10 000
What I need to do for showing all records in dataset and how can I receive true counter of list?
P.S. Sorry for my English, its not my native language.