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. Image for the cookie policy date

GDBG. How can I decrease column width?

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

1 Reply

AD Administrator Syncfusion Team 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?

Loader.
Live Chat Icon For mobile
Up arrow icon