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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ColWidths - DataBoundGrid

Thread ID:





54865 Jan 18,2007 09:47 PM UTC Jan 18,2007 10:05 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On January 18, 2007 09:47 PM UTC

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

For some reason, ColWidth is not changing.

Administrator [Syncfusion]
Replied On 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,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon