Datagrid column widths in edit mode

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. When setting a certain the EditItemIndex of a certain row of a datagrid,
the columns in the row increases its width thus increasing the width of the
entire datagrid. Where do you control this? I've played around with my CSS
file and the actual properties settings but still get the same results.

Thanks for any help.
 
Hi Elmer,

You can set this property in the <EditItemStyle Width="" /> tag inside the
DataGrid tag.

Cheers,
Steve Goodyear
Vancouver, Canada
 
Hi, Elmer.

I had a similar issue in needing to set the width of the columns.
There may be more elegant ways to do this, but here's what I did.

In the Page_Load event I set the width of my grid like this:
dgCRM.Width = New Unit(760)

And then in the Item_Created Event of the datagrid, I had this command
to set the width for a particular column:

e.Item.Cells(0).Width = New Unit(130, UnitType.Pixel)


Hope this helps.

Jennifer
 
thanks for the help! just discovered that it also helps to make the column a
template column.
 
Back
Top