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.

Resizing datagrid rowheader column

Thread ID:





32992 Aug 11,2005 12:19 AM Aug 12,2005 03:16 AM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On August 11, 2005 12:19 AM

I''d like to resize the rowheader column of a GridDataBoundGrid control but find that using grid.Model.ColWidths[0] = 20 resizes all columns (including the rowheader) to the same width. How can I resize just the rowheader column? TIA

Administrator [Syncfusion]
Replied On August 11, 2005 04:27 AM

I think your code is the way to do this. But if you want to do this when the grid is not visible (like in Form.Load), then you also have to set: this.gridDataBoundGrid1.AllowResizeToFit = false; But turning AllowResizeToFit to false, will prevent the other columns to be sized to fit by default. If you want this to happen, then you would also add a call to ResizeToFit. this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(1, this.gridDataBoundGrid1.Model.ColCount), GridResizeToFitOptions.IncludeHeaders); Here is a little sample showing this working. http://www.syncfusion.com/Support/user/uploads/GDBG_SizeRowHeader_460c5d41.zip

Administrator [Syncfusion]
Replied On August 11, 2005 10:45 PM

Thanks for your prompt reply Clay however your suggestion only seems to work when the GridDataBoundGrid control is placed on the form in the designer. I still get the same strange behaviour when instantiating and placing the control on the page entirely through code. Any other ideas?

Administrator [Syncfusion]
Replied On August 12, 2005 03:16 AM

I think the same sort of code should work at runtime. Here is the sample with the grid being created and displayed in a button handler. http://www.syncfusion.com/Support/user/uploads/GDBG_SizeRowHeader_4591632b.zip Can you modify this sample to show the problem you are having?


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.