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.

Setting column width on GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

61407 May 25,2007 01:15 AM May 25,2007 04:30 AM Windows Forms 1
loading
Tags: GridControl
Russell Coombes
Asked On May 25, 2007 01:15 AM

Hi Guys,

I have a GridGroupingControl with a single column. I want to set the column width so that it spans the entire width of the grid. I thought this should be a simple exercise, but it is not.

So far, I have tried:

myGrid.TableModel.ColWidths[0] = myWidth;

myGrid.TableDescriptor.Columns[0].Width = myWidth;

myGrid.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Table());

I have tried all of the above statements, and none of them seem to work no matter what the following setting is:

myGrid.TableDescriptor.AllowCalculateMaxColumnWidth = true; // false doesn't work either!

I also thought I'd try the example here...

http://www.syncfusion.com//support/kb/grid/Default.aspx?ToDo=view&questId=70

But the attached code and example is for a GridDataBoundGrid not a GridGroupingControl.

So - can Syncfusion please tell me - What is it that I need to do to get my single column width to span the entire grid?

Regards,
Russell

Administrator [Syncfusion]
Replied On May 25, 2007 04:30 AM

Try this code.

grid.TableDescriptor.Columns[0].Width = grid.ClientRectangle.Width - grid.TableOptions.RowHeaderWidth - SystemInformation.VerticalScrollBarWidth;


Here is a little sample.

WindowsApplication315.zip

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.

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.

;