I wrote a JQUERY plug-in. To achieve the effect of grouping.
Figure 2. This is a simple grouping effect, grouped by the first "Department" column of the table
Figure 3. You can also group multiple columns based on the first column "Department" and fourth column "Gender. Before grouping, sort the columns to be selected, which can be completed during data extraction,
It is not implemented on the client.
Figure 4. You can set the parameter collapse = 1 to contract the table first. The default value is 0;
By writing this JQuery control, I deeply realized its strength. The entire Code contains less than 100 lines.
In ASP. NET. The TBODY flag is not added when the gridView is displayed by default. To make the GridView class display in TBODY, you can add the following code in Page load:
GridView1.UseAccessibleHeader = true; GridView1.HeaderRow. TableSection = TableRowSection. TableHeader; GridView1.FooterRow. TableSection = TableRowSection. TableFooter;
In this way, you can use JQuery. groupTable to process the table generated by the gridview.
Package download
You are welcome to give more comments.