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. Image for the cookie policy date
close icon

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

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!

3 Replies

AD Administrator Syncfusion Team November 13, 2006 05:41 AM UTC

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.
http://www.syncfusion.com/Support/user/uploads/Lastcolumnfill_7e8d66a9.zip

Best Regards,
Haneef


JA jamesb November 13, 2006 07:58 PM UTC

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!


AD Administrator Syncfusion Team November 22, 2006 04:29 AM UTC

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,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon