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.

Resizing GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

74038 May 28,2008 07:25 PM May 30,2008 12:39 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 28, 2008 07:25 PM

Hello

I'm using a grid grouping control and I want to resize the entire control when i expand a group.
ie. I expand a group and instead of scrollbars appearing the entire control resizes so all the rows are visible.

Can I have some advice on how to do this?


Sri Rajan [Syncfusion]
Replied On May 29, 2008 06:56 AM

Hi Squish,

Thank your interest in Syncfusion products.

If your intension is to view all the rows without showing scrollbar when you expand a group, then you can achieve this by using QueryRowHeight event. QueryRowHeight event is used to set the Height of rows. Please refer the below code for more details.

void TableModel_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e)
{
e.Size = (this.gridGroupingControl1.Height / this.gridGroupingControl1.TableControl.Model.RowCount);
e.Handled = true;
}


Please let me know if this helps.

Best Regards,
Srirajan


Administrator [Syncfusion]
Replied On May 29, 2008 11:22 AM

This isn't quite what I was looking for.
I want the row heights to stay the same, and the actual grid grouping control displaying the grid to get bigger.

For example
If I have a 100 pixel high grid grouping control, and the grid actually has 20, 10 pixel high rows. The grid will be 200 pixels which is smaller then the display height of the control (100 pixels) so a scroll bar will appear.
I want the control to resize to have a height of 200 pixels

Thanks


Sri Rajan [Syncfusion]
Replied On May 30, 2008 12:39 AM

Hi Squish,

Thank you for your interest in Syncfusion products.

You need to handle QueryCellStyleInfo event and set the height of GridGroupingControl to achieve this task. Please refer the below code snippet for more detais.

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
rowcount = this.gridGroupingControl1.TableControl.Model.RowCount;
this.gridGroupingControl1.Height = (rowheight * rowcount);
}


Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F74038/main.htm

Best Regards,
Srirajan


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.

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.

;