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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid / Column Width

Thread ID:

Created:

Updated:

Platform:

Replies:

68718 Sep 28,2007 01:07 PM UTC Sep 28,2007 06:39 PM UTC WinForms 1
loading
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,
Haneef

CONFIRMATION

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.

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

;