JJ
Jisha Joy
Syncfusion Team
February 23, 2009 06:25 AM UTC
Hi Gurtaran,
Issue 1: Row Height
By default resizing of individual rows is not supported in GridGroupingControl. But the desired behavior can be achieved by using a CustomEngine. Please refer the following sample in our sample browser
..\\My Documents\Syncfusion\EssentialStudio\{version number}\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\ResizableRows\cs
This sample demonstrates the features of re-sizing individual rows in the grid. It also illustrates how to implement the "IGridRowHeight" interface and it's routines for getting and setting row heights for elements.
Issue 2: Apply styles to individual cells
In GridGroupingControl you need to handle either QueryCellStyleInfo or PrepareViewStyleInfo for applying styles at cell level. Please see the code:
this.gridGroupingControl1.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);
this.gridGroupingControl1.TableControl.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(TableControl_PrepareViewStyleInfo);
void TableControl_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if(e.RowIndex== 5 && e.ColIndex==30
e.Style.BackColor = Color.Green;
}
void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.ColIndex == 2 && e.TableCellIdentity.RowIndex == 5)
e.Style.BackColor = Color.Red;
}
Issue 3: The grid to be not editable but still be able to navigate through the cells.
This can be achieved by using the following code snippets.
this.gridGroupingControl1.TableDescriptor.AllowEdit = false;
this.gridGroupingControl1.TableDescriptor.AllowNew = false;
Please let me know if you have any questions.
Regards,
Jisha