Groups | Blog | Home
all groups > asp.net building controls > december 2005 >

asp.net building controls : Custom Column Widths


cbanks NO[at]SPAM bjtsupport.com
12/28/2005 7:54:22 AM
I have a datagrid which displays five columns of data. Since several
columns display "Y" or "N" or 1-9 I have modified all the column widths
to display my data. Under normal viewing, the grid looks great when
filled with data. When I go into an edit mode on a row, everything
get's messed up. Some columns go narrow, while others go wider (not
like a 'default' grid).
Is there a way to maintain custom widths when you go into an edit mode?
I have two buttons at in the last two columns; Edit and Delete, which
become Update and Cancel.

Thanks
Charles
Mike MacMillan
12/28/2005 1:26:39 PM
cbanks,
when you edit a row, custom html is written to handle editing that
could possibly skew a table with strictly sized column widths. try
overriding the EditItemStyle property of the DataGrid control to
provide your own style for the edit controls.

hope this helps,
Mike MacMillan


[quoted text, click to view]
cbanks NO[at]SPAM bjtsupport.com
12/28/2005 1:52:31 PM
Mike,

I looked at html before writing to the board, which is why I thought I
was missing something. I saw the styles for select, edit and
alternating items, which all match what I want. I also only saw one
entry for each of my columns that also had all the correct settings.
My edit item matches all other settings:
<ItemStyle Font-Size="Smaller" Font-Names="Arial"></ItemStyle>
<EditItemStyle Font-Size="Smaller" Font-Names="Arial"></EditItemStyle>
Could you please tell me if I need something more?

Thanks
AddThis Social Bookmark Button