Datagrid column widths in edit mode

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.
 
G

Guest

Hi Elmer,

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

Cheers,
Steve Goodyear
Vancouver, Canada
 
J

jennifer1970

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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top