GridDataBoundGrid / Column Width

I have a GridDataBoundGrid control with 2 columns. Now I wanted to set the width of the columns but could find were to do that?

Could anybody help me on that?

BR & Thanx

1 Reply

HA haneefm Syncfusion Team September 28, 2007 06:39 PM UTC

Hi Christoph,

By default, the GridDataBoundGrid tries to autosize the columns based on headertext. The AllowResizeToFit = false turns off this default sizing.

this.gridDataBoundGrid1.AllowResizeToFit = false;

You can explictly set the size of the column by using the Model.ColWidths collection property. Below are the code that set the columnwidth of second column.

this.gridDataBoundGrid1.Model.ColWidths[2] = 300;

Best Regards,
Haneef

Loader.
Up arrow icon