My data is such that I want to display values for the Employee and the Supervisor for a particular record. Instead of describing it, I’ll show you a rough example:
<table><tr> <th colspan='3'>Employee</th> <th colspan='3'>Supervisor</th> </tr><tr> <th>Name</th> <th>Last Activity</th> <th>Count</th> <th>Name</th> <th>Last Activity</th> <th>Count</th> </tr> </table>
How can I create this for a GridView? I essentially want 2 rows for the headings, and some of the cells should span more than one column.
do you need the editing or sorting features of the gridview? I’ve found trying to do anything aside from display straight tabular data in the gridview is an exercise in patience.
For simplicity’s sake I’d recommend using a repeater and writing your own table HTML if your grid is readonly.
Editing to reply to the comment below.
You can, but it is by no means easy. If you haven’t already and you can afford to switch you may want to look at ASP.NET MVC, it gives you complete control of the HTML. You may want to check out this link about data-access in general. http://www.asp.net/learn/data-access/ #15, #27, #51-53 may get you some ideas pertinent to your gridview issue.