protected void Grid1_RowDataBound(object sender, Obout.Grid.GridRowEventArgs e) { if (e.Row.RowType == GridRowType.DataRow) { e.Row.Cells[1].Width = (what ever you want(int value only)); } }
<asp:boundfield xmlns:asp="#unknown"> DataField="Column_Name" HeaderText="Column_Name" > <HeaderStyle Width="180px"> <itemstyle width="180px"></itemstyle> </asp:boundfield>
foreach (DataGridViewColumn c in dataGridView1.Columns) { //the if statement depents on how you can search your data if (c.Name == "TheNameOfTheColumn") { c.Width = 250; } if (c.HeaderText == "TheHeaderTextYouWant") { c.Width = 500; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)