Grid resize at run time

Ananda

Newcomer
Joined
May 4, 2004
Messages
13
Hello

Can any one tell me how to resize the column of the grid at run time in a web page using ASP.NET? Also the swapping of the columns should be possible in the same. If you know any third party component also please inform me.

Thanks
Arunagiri
 
Hi,

You can use the ItemDataBound event of DataGrid to access cells width property before it is rendered.

private void DataGrid1OnItemBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Cells[0].Width = 200;
}

}

HTH
 
Back
Top