We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ColWidths - DataBoundGrid

I'm trying to set ColWidth of a databound grid using
gdbg.Model.ColWidths[3]= 300;

For some reason, ColWidth is not changing.


1 Reply

AD Administrator Syncfusion Team January 18, 2007 10:05 PM UTC

Hi Shankar,

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

If you do not turn it off, the grid trying to size things based on headertext can step on any explicit sizing you try to do. Here is a code snippet

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

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon