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.
Syncfusion Feedback

GridGroupingControl and multiple tables - column autosize

Thread ID:

Created:

Updated:

Platform:

Replies:

33426 Aug 19,2005 11:50 AM UTC Aug 22,2005 09:25 AM UTC Windows Forms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 19, 2005 11:50 AM UTC

Hi together, I have a dataset with multiple colums. Now I want to autosize the columns of table "A" grGrCo_SeqDef.GetTableDescriptor("A").AllowCalculateMaxColumnWidth = false; GridTableModel tm = grGrCo_SeqDef.GetTableModel("A"); tm.Table.FilteredChildTable = null; tm.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders); So the code above does autosizing of all columns, but not correctly. Let''s assume I have in column "Name" of table "A" a value like "This is just a test" then I can''t see the whole value. What I am doing wrong? Cheers, Markus

Administrator [Syncfusion]
Replied On August 19, 2005 12:22 PM UTC

Try including this flag in the GridResizeToFitOptions, IncludeCellsWithinCoveredRange. model.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders | GridResizeToFitOptions.IncludeCellsWithinCoveredRange);

Administrator [Syncfusion]
Replied On August 19, 2005 12:54 PM UTC

Hmm, no this doesn''t work. Only my last column gets wider, but this one doesn''t include the long cell value. The long cell value is in the first column and this one doesn''t get wider. Any ideas? Cheers, Markus >Try including this flag in the GridResizeToFitOptions, IncludeCellsWithinCoveredRange. > >model.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders | GridResizeToFitOptions.IncludeCellsWithinCoveredRange); >

Administrator [Syncfusion]
Replied On August 19, 2005 01:22 PM UTC

It seems to work for me in this sample using the 3.3 RC. The button click sizes the ChildTable. http://www.syncfusion.com/Support/user/uploads/GGC_MinimalNestedtables_b0e08cfe.zip Can you see a problem in this sample?

Administrator [Syncfusion]
Replied On August 19, 2005 01:33 PM UTC

Thanks for your example - I will have a closer look at it.

Administrator [Syncfusion]
Replied On August 21, 2005 02:31 PM UTC

Thanks - the example works great. But I have another question. I want the grid to fill the client area of the gridgroupingcontrol (so that the columns fill the complete area) - and additional I want the autosize feature of the columns (to fit the cell content). Furthermore the grid is bound to a dataset with 4 tables and so the issues above should work for each table - How can this be done? Is there a small code sample available?? Any help would be great - Thanks in advance Cheers, Markus

Administrator [Syncfusion]
Replied On August 22, 2005 09:25 AM UTC

I do not really have a good solution for this. Here is a try at sizing the last column as the grid is displayed. http://www.syncfusion.com/Support/user/uploads/fillrightcolGGC_3da492c.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.

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

;