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.

GDBG. How can I decrease column width?

Thread ID:





14324 May 25,2004 07:02 AM May 25,2004 07:28 AM Windows Forms 1
Tags: GridControl
Asked On May 25, 2004 07:02 AM

Hi All, I need to decrease width of first two columns in the grid. My code is: grdData.Model.ColWidths[0] = 5; grdData.Model.ColWidths[1] = 5; But it does not work. on the other hand next code works correctly: grdData.Model.ColWidths[0] = 100; grdData.Model.ColWidths[1] = 100; Please see attached screens pics_4567.zip

Administrator [Syncfusion]
Replied On May 25, 2004 07:28 AM

If you want to explicitly set sizes in a GridDataBoundGrid, then make sure you have set grid.AllowResizeToFit = false. This will turn off the default sizing so your sizing will ''take''. This code worked ok for me in Form_Load. this.gridDataBoundGrid1.AllowResizeToFit = false; this.gridDataBoundGrid1.Model.ColWidths[0] = 5; this.gridDataBoundGrid1.Model.ColWidths[1] = 5; If this does not explain the problem, can you post a little sample showing it?


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.