DataGrid automatic resize control

  • Thread starter Thread starter Carlo Marchesoni
  • Start date Start date
C

Carlo Marchesoni

I have a very basic question using the DataGrid. What I
want to achieve is controlling the size of it (specially
the height of the rows). The DataGrid adjusts the row
size according to the amount of rows bound - and if there
are no rows at all, the DataGrid is visualized with a
huge Header and nothing else.
How can I avoid this ?
Thanks a lot for your help
 
Hi Carlo,

Thanks for posting in this group.
If you do not use the cssClass, the datagrid will use your design-time
setting of height and width for generated table.
The entire table's height and width is fixed, so each row's height is
determine by the rows of the data.
To fix each row's height, I think you should insert several empty datarow
into the datagrid.
The article below talks about how to get this done:
http://www.aspheute.com/english/20030909.asp

More, the datagrid's height may be enlarged at runtime because of the
content of data.(The cell's height will be enlarged to contain all the
wrapped datas of this cell)

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top