Configure a Datagrid's header?

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
 
M

Munna

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top