Bound Datagrid Width

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
 
G

Guest

sorry...i forgot to mention that it's a web application...i don't think
DataGridTableStyle is available for web applications...
 
B

bfking

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

Guest

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

Guest

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?
 
B

bfking

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.
 

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

Top