Tuesday, April 15, 2008

How to examine if the datagrid item created is the header item

Code example in the ItemDataBound event handler:

protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{

if (e.Item.ItemType == ListItemType.Header)
{
//This row is the header of the grid.
//Add code to do whatever you want to the header

}

}

No comments: