Data Grid problem

  • Thread starter Thread starter Calvin Lai
  • Start date Start date
C

Calvin Lai

Hi all,

For the editing mode in DataGrid, all those columns will be displayed as
TextBox. Is there any way to configure the number of columns (or width) of
those TextBox when displaying for each column? Right now even the data is
only a few characters, the textbox is showing SO BIG that the row is extened
to multiple screens horizontal...

Thanks for all advice.
 
One method is to do the following in itemdatabound event. In this example
displaygrid1 is the control id and the texbox is in the second column. You
will probably have to mess with the other columns also. There may be other
ways to do this.

if displaygrid1.EditItemIndex > -1 then
if displaygrid1.EditItemIndex = e.item.itemindex then
ctype(e.Item.Cells(1).controls(0),textbox).Width = Unit.Pixel(35)
 
Back
Top