Home Forums WinForms controls Xceed Grid for WinForms GroupBy Row Counts Issue with Extensibility Filtering Method Reply To: GroupBy Row Counts Issue with Extensibility Filtering Method

User (Old forums)
Member
Post count: 23064

The best is to filter the source, but if you can’t do this for whatever reason, we have a very ugly workaround.

First, you need to add an unbound column with its Visible property set to false.  Second, subscribe to the AddingDataRow event, and in the event handler, set the value of the cell corresponding to this column to a reference to a static object (so no unnecessary memory is used).  Third, set the TitleFormat property on the GroupManagerRow to the stat function %COUNT:%, using the unbound invisible column as the target of the function.

Finally, when hiding a row, you will need to set the cell value of the hidden column to null.  When showing a row, you will need to set it back to the static object.

This will display the right row count, because the COUNT function does not add cells with null values.

Note that the grid does not offer a filter feature.  We provide this as a sample, with no guarantee it works in all scenarios.  It is a basic implementation, that needs to be incremented on to become robust.

Imported from legacy forums. Posted by André (had 1512 views)