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

GridDataBoundGrid / Column Width

Thread ID:





68718 Sep 28,2007 01:07 PM UTC Sep 28,2007 06:39 PM UTC WinForms 1
Tags: GridControl
Christoph Gasser
Asked On September 28, 2007 01:07 PM UTC

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 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,


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