 ---------------------------------------------------
|                                                   |
| Group Row Count Manager                           |
|                                                   |
| iGrid.NET Extra Samples                           |
| Copyright (c) 10Tec Company                       |
| All rights reserved                               |
|                                                   |
| Available editions:                               |
| >> iGrid.NET 2.5, VS2005 C#/VB.NET                |
|                                                   |
 ---------------------------------------------------

Description:
============
Sometimes we need to modify the contents of the group rows created automatically by iGrid.NET (for instance, when the user groups the grid), and add to them our own text. This sample gives you an idea of how to do that showing the total number of rows in each group.

This task is implemented in a form of a ready-to-use class called iGGroupRowCountManager. To use it in your project, just add this class to it (the class is implemented in a separate file), declare a variable which stores a new instance of this class on the form level, and call its Attach method to attach the manager to the require grid. For example, if you have a GRCM variable of the iGGroupRowSumManager object type, it will look like the following:

GRCM.Attach(iGrid1)

That's all. After this is done, the Group Row Count Manager will display the required counters as an additional text "(Count = ...)" at the end of each group row text.


Short Code Explanation:
=======================
The iGGroupRowCountManager class exploits the AfterContentsGrouped event of the specified grid and does all the work in it. Look into the code of this event handler to see how the number of rows in group is calculated using an effective algorithm which enumerates all the iGrid rows from bottom to top in one pass.

