Configure a Datagrid's header?

  • Thread starter Thread starter Mark B
  • Start date Start date
M

Mark B

How can I configure a Datagrid's header to display:

Group Name <---Last 30 Days --->| <---Last 60 Days --->|
Sales Returns Sales Returns
 
Hi ,

This is a simple trick may work for you...

subscribe the rowcreated event of gridview

protected void GridView1_RowCreated(object sender,
GridViewRowEventArgs e)
{
var x = 0;
if (e.Row.RowType == DataControlRowType.Header)
{
x = 1;
TableCell cell = new TableCell();
cell.ColumnSpan = 2;
cell.Text = "I can do what ever i want with
datagrid!";
e.Row.Cells.Clear();
e.Row.Cells.Add(cell);
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
x = 2;
}
else
{
x = 3;
}
}

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
 
Back
Top