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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ResizeToFit and nested tables

Thread ID:

Created:

Updated:

Platform:

Replies:

34123 Sep 2,2005 09:47 AM UTC Sep 2,2005 02:29 PM UTC WinForms 1
loading
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)
{
	this.gridGroupingControl1.BeginUpdate();
	GridTableDescriptor parentTD = this.gridGroupingControl1.TableDescriptor;
	GridTableControl tc  = this.gridGroupingControl1.GetTableControl(parentTD.Name);
	tc.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());
	
	GridTableDescriptor childTD = parentTD.Relations["ParentToChild"].ChildTableDescriptor;
	tc  = this.gridGroupingControl1.GetTableControl(childTD.Name);
	tc.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());

	GridTableDescriptor gridChildTD = childTD.Relations["ChildToGrandChild"].ChildTableDescriptor;
	tc  = this.gridGroupingControl1.GetTableControl(gridChildTD.Name);
	tc.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());
	this.gridGroupingControl1.EndUpdate(true);
}

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

;