Changing header row size for child table.

Hi All,

I am looking for the below things.Can someone please advise.

1. How to change the child's table header row size.
2. How to apply a conditional formatting on just the cell that meets the criteria and not the entire row.eg we can have a conditional format but it allows only to change the appearance of anyrecord field cell.Whereas i am more interedted in doing just for the cell that meets the filter criteria.
3. on disable the cells for editing i am not able to navigate through columns using right/left arrow key.I would ideally like the grid to be not editable but still be able to navigate through the cells.

Any help will be really appreciated.

Many thanks.
Gurtaran




1 Reply

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


Loader.
Up arrow icon