Grouping in GridViewWhen we start writing apps in asp.net, we always get hold off if we miss some functionality that we desperately need to roll out the solution. And the case is true always when we write code with Asp.Net's GridView control... When i started with one of the developments (Web Portal), i was running into issues since i dont have those expected functionalities available in the classic asp.net 2.0 controls. I was being asked by the business owners to have grouping in the listing while display data. The only option left off is to go for third party components like infragistics and i have to shed dollars from my pocket to have it done. Having said that, i started thinking.. "Why can't i have a simple control extended from the classic to have those required functionalites instead buying..?". There i started..And i became successfull in delivering the solution .Now the control is complete and i have few more ideas to be incorporated within the control, but in future. The control is free to use and distribute with no restrictions and royality. The current version has only GridView with grouping functionality based on DataKeys and record indexing, all with CSS styles....
How to use the control?
- Download the control from the link below
- Add the control to your ToolBox panel by locating the dll file.
- Drag ZNetGridView on your .aspx form
- Define the properties of the control
- For grouping, make EnableGrouping = true and set the CSS for Grouping header inside the "Grouping" cateogry of properties window. To make grouping inside the control, you have to first specify the datakey(s) for data binding and then specify the "GroupingDataKeyIndex" for grouping so that the control will group with respect to that particular datakey. Care should be taken that the GroupingDataKeyIndex should always be less than count of datakey(s)
- User has the option to make the header visible inside each group (multi header gridview) as below.
To enable it, make "ShowColumnHeaderInsideGroups" = true
- For record indexing, make "EnableRecordIndexing" = true in the "Record Indexing" cateogory of property dialog box. You can set the header text for indexing column and CSS styles as well
The latest release of the control is available for downlad at http://code.msdn.microsoft.com/ZNetControls
Tested Platforms : IE and FireFox browsers.