Bound Datagrid Width

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

Guest

After I bind my datagrid, it seems to automatically increase it's width to
fit the data in the columns...I want to be able to set the grid's width after
binding the data...but for some reason....

DataGrid1.Width = 100;

does not seem to work...does anyone know why or how I can change the width
after binding the data?

Parveen
 
sorry...i forgot to mention that it's a web application...i don't think
DataGridTableStyle is available for web applications...
 
all the DataGrid does is render an HTML Table. it's not an issue of
where you set the width, it's an issue of the data not fitting in the
table. the table will expand past your set width if the data is too
long.

make sure that you have ItemStyle-Wrap="False", so the data will wrap
instead pushing the table out.
 
I tried this but it doesn't work...the data is wrapping within the
cells...but the grid keeps expanding...i don't know why...
 
After binding the datagrid, I try to change the width of one of the columns.
I can tell that the text in the cells is being wrapped but the column is
still too wide...i don't know why i can't get rid of the extra space....does
anyone know what's going on?
 
look at the html output. make sure that the width attribute of the
table cell is getting written. also, make sure you have
CellPadding="0". if you want, paste the whole html table here and i'll
look at it.
 
Back
Top