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

GGC ResizeToFit when grouped on form_load

Thread ID:

Created:

Updated:

Platform:

Replies:

37738 Nov 29,2005 03:51 PM UTC Nov 29,2005 06:09 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 29, 2005 03:51 PM UTC

I am having a problem with ResizeToFit if I add grouped columns in form_load. If I include these statements: .GroupedColumns.Add("Status",ListSortDirection.Descending) .GroupedColumns.Add("LastActivityDateAsDate", ListSortDirection.Ascending) This resizetofit call resizes badly: .ColWidths.ResizeToFit(GridRangeInfo.Table.ExpandRange(1, 1, .RowCount, .ColCount),GridResizeToFitOptions.None) I''ve tried different resizetofitoptions but none seem to make a difference. The same statement resizes correctly if the grid is loaded ungrouped and the user groups it. I am calling resizetofit in the FormSizeChanged and CategorizedRecords events. Is there anyway to add grouped columns later than at the end of form_load? Thanks, Dave Erwin

Administrator [Syncfusion]
Replied On November 29, 2005 04:50 PM UTC

>>Is there anyway to add grouped columns later than at the end of form_load? At the end of form.load, you can create a Timer with a small interval and a Tick event. In the event handler, stop the timer, unsubscribe to the event and do the grouping there.
//At the bottom of form.load
Timer t = new Timer();
t.Interval = 20;
t.Tick += new EventHandler(t_Tick);
t.Start();

//the handler
private void t_Tick(object sender, EventArgs e)
{
	Timer t = sender as Timer;
	t.Stop();
	t.Tick -= new EventHandler(t_Tick);
	t.Dispose();

	//do your grouping and sizing;
}

Administrator [Syncfusion]
Replied On November 29, 2005 05:27 PM UTC

Thanks, I''ll give that a try. Is there a reason why resizetofit behaves this way? Dave Erwin

Administrator [Syncfusion]
Replied On November 29, 2005 06:09 PM UTC

The GridGroupingControl has does its own resizing the very first time the grid is about to be drawn. I suspect this resizing is stepping on the resizing you are trying to do.

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;