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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ResizeToFit and nested tables

Thread ID:





34123 Sep 2,2005 09:47 AM UTC Sep 2,2005 02:29 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On September 2, 2005 09:47 AM UTC

I have a gridgroupingcontrol which is bound to a dataset (which contains two tables). How can i autosize all columns for both tables (also cells of cell type combobox). Any ideas?

Administrator [Syncfusion]
Replied On September 2, 2005 02:29 PM UTC

The only way I know would be to call TableControl.Model.ColWidths.ResizeToFit on each of the tables. Here is a button handler that does this for a 3 tables releated tables, parent, child and grandchild.
private void button1_Click(object sender, System.EventArgs e)
	GridTableDescriptor parentTD = this.gridGroupingControl1.TableDescriptor;
	GridTableControl tc  = this.gridGroupingControl1.GetTableControl(parentTD.Name);
	GridTableDescriptor childTD = parentTD.Relations["ParentToChild"].ChildTableDescriptor;
	tc  = this.gridGroupingControl1.GetTableControl(childTD.Name);

	GridTableDescriptor gridChildTD = childTD.Relations["ChildToGrandChild"].ChildTableDescriptor;
	tc  = this.gridGroupingControl1.GetTableControl(gridChildTD.Name);


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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