Add header to gridview - Header on 2 rows
Code .NET SQL :: ASP.NET :: C# :: Gridview
Page 1 sur 1
Add header to gridview - Header on 2 rows
- Code:
protected void GridViewBreakDownHistory_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
//Build custom header.
GridView oGridView = (GridView)sender;
GridViewRow oGridViewRow = new GridViewRow(0,0, DataControlRowType.Header, DataControlRowState.Normal);
TableCell oTableCell = new TableCell();
//Add Site 1
oTableCell.Text = "Site 1";
oTableCell.ColumnSpan = 2;
oGridViewRow.Cells.Add(oTableCell);
//Add Site 2
oTableCell = new TableCell();
oTableCell.Text = "Site 2";
oTableCell.ColumnSpan = 2;
oGridViewRow.Cells.Add(oTableCell);
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}
Sujets similaires
» Dynamically Create column in GridView
» GridView RowDataBound
» GridView : DataKeys
» gridview date format
» RadioButton dans Gridview
» GridView RowDataBound
» GridView : DataKeys
» gridview date format
» RadioButton dans Gridview
Code .NET SQL :: ASP.NET :: C# :: Gridview
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum