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.

auto-fit column width and auto-wrap to multiple rows

Thread ID:

Created:

Updated:

Platform:

Replies:

60033 Apr 26,2007 11:36 AM Apr 26,2007 01:19 PM Windows Forms 1
loading
Tags: GridControl
Lan Mo
Asked On April 26, 2007 11:36 AM

Hi,
V4.4.0.51 & VS2003

In form with GGC, there are situation with a lot of columns such as 30 fields(or columns) for a record. I want to add two option buttons to automatically to change the grid layout.

1. button for Auto-fit-content width
click this button, it will automatically to adjust all columns' width to fit its content.

2. button for Auto-Wrap-to-multiple- rows
click this button, first, it will adjust all columns' width to fit its content. then it will wrap a record row to multiple lines to make all columns visible.

Do you have any built-in property or methed to this? Any samples?

Thanks,

Lan

haneefm [Syncfusion]
Replied On April 26, 2007 01:19 PM

Hi Lan,

Issue 1:

You can try this code snippet to resize the column-width to fit its content

this.gridGroupingControl1.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Table(),GridResizeToFitOptions.GridResizeToFitOptions.IncludeHeaders );

Issue 2:
One comment is that by default, the GridGroupingControl does not support rows with individualized rowheights. To get this support, you need to add a custom GridEngine as in the ResizableRows browser sample( \Essential Studio\4.4.0.49\windows\Grid.Grouping.Windows\Samples\FeatureSamples\ResizableRows ). The ResizableRows browser sample also shows you how to implement the IGridRowHeight interface and its routines for getting and setting row heights for elements.

Once you have this, then you can call TableControl.Model.RowHeights.ResizeToFit to handle either of these cases. Here is a little sample.
http://www.syncfusion.com/Support/user/uploads/GGC_Forum_ResizeToFit_a41fcf80.zip

Best regards,
Haneef

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.

;