Hi,
For nested grid display query have a look on the following link
http://mosesofegypt.net/post/2008/02/24/Building-a-grouping-Grid-with-GridView-and-ASPNET-AJAX-toolkit-CollapsiblePanel.aspx[
^]
To have multiple headers in your grid try the following code.
protected void gvEmployee_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView oGridView = (GridView)sender;
GridViewRow oGridViewRow = new GridViewRow(0, 0,
DataControlRowType.Header, DataControlRowState.Insert);
TableCell oTableCell = new TableCell();
oTableCell.Text = "Employee Details";
oTableCell.ColumnSpan = 9;
oGridViewRow.Cells.Add(oTableCell);
oTableCell.CssClass = "header";
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}
if you want a header like as follows.
Deparments
X Y Z
then
protected void gvEmployee_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView oGridView = (GridView)sender;
GridViewRow oGridViewRow = new GridViewRow(0, 0,
DataControlRowType.Header, DataControlRowState.Insert);
TableCell oTableCell = new TableCell();
oTableCell.Text = "Departments";
oTableCell.ColumnSpan = 3;
oGridViewRow.Cells.Add(oTableCell);
oTableCell.CssClass = "header";
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}
Hope this helps.