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.

How to make the last column of the ggc fill out the grid''s remaining area, if any exist?

Thread ID:





51692 Nov 10,2006 05:14 PM Nov 21,2006 11:29 PM Windows Forms 3
Tags: Grouping
Asked On November 10, 2006 05:14 PM

I'm sure this has been answered somewhere on this forum before.

But here's what I'm trying to accomplish.

I want the LAST COLUMN of the ggc to fill out the remaining space, IF ANY, ot the grid area.

Can you all point me in the right direction!

Administrator [Syncfusion]
Replied On November 13, 2006 12:41 AM

Hi James,

You can handle the TableModel.QueryColWidth and set the width of column using GetTotal method. Here is a code snippet

private void TableModel_QueryColWidth(object sender, GridRowColSizeEventArgs e)
GridTableModel model = sender as GridTableModel;
GridTableDescriptor td = model.Table.TableDescriptor;

if( e.Index == td.VisibleColumns.Count)
e.Handled = true;

GridTableControl tc = this.gridGroupingControl1.GetTableControl(td.Name);
//To avoid the Stack Overflow Exception....you need to unsubscribe the QueryColWidth event
model.QueryColWidth -=new GridRowColSizeEventHandler(TableModel_QueryColWidth);
int width = tc.ClientRectangle.Size.Width - model.ColWidths.GetTotal(0,3) + 75 ;
model.QueryColWidth +=new GridRowColSizeEventHandler(TableModel_QueryColWidth);
e.Size = width;


Here is a sample.

Best Regards,

Replied On November 13, 2006 02:58 PM

It works fine... the only problem is that now my column heading text has dissapear. The column header is there, but the text that was originally there is blank!

Administrator [Syncfusion]
Replied On November 21, 2006 11:29 PM

Hi James,

Thanks for being patience.

We were not able to reproduce the issue here. Could you please provide a sample having the issue? This will help us to analyse the issue further.

Best Regards,


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.