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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG. How can I decrease column width?

Thread ID:





14324 May 25,2004 11:02 AM UTC May 25,2004 11:28 AM UTC WinForms 1
Tags: GridControl
Asked On May 25, 2004 11:02 AM UTC

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 11:28 AM UTC

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.

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

Live Chat Icon For mobile
Live Chat Icon