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.
Unfortunately, activation email could not send to your email. Please try again.

GridDataBoundGrid / Column Width

Thread ID:





68718 Sep 28,2007 09:07 AM Sep 28,2007 02:39 PM Windows Forms 1
Tags: GridControl
Christoph Gasser
Asked On September 28, 2007 09:07 AM

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

haneefm [Syncfusion]
Replied On September 28, 2007 02:39 PM

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,


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.

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.