Resizing GridGroupingControl

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?


3 Replies

SR Sri Rajan Syncfusion Team May 29, 2008 10:56 AM UTC

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



AD Administrator Syncfusion Team May 29, 2008 03:22 PM UTC

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



SR Sri Rajan Syncfusion Team May 30, 2008 04:39 AM UTC

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


Loader.
Up arrow icon