AD
Administrator
Syncfusion Team
January 23, 2007 06:18 PM UTC
Hi James,
Thanks for being patience.
The reason for the style is being reset is that the grid will query for the cell style properties when it draws or re-draw it on the screen. In this case, the grid tries to re-draw the cells, when the form re-sizes.
The setting of style properties using the QueryCellStyleInfo event doesn’t affect performance if proper conditional statements are given. For example, to set text color for the records the drawing display element can be checked for record row and accordingly set the style property.
Generally, in GridGroupingControl the style properties for the cell are set by checking for TableCellType and accordingly changed.
In the following code snippet, the style has been changed for a summary cell. This statement only executed only when the summary cell is displayed on the display screen.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// QueryCellStyleInfo event.
if (e.TableCellIdentity.TableCellType == GridTableCellType.SummaryFieldCell)
{
e.Style.BackColor = Color.AliceBlue;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
In your code snippet, the flag in the event is not required because the statement will be executed only when the row index with 1 is displayed in the screen and this doesn’t affect your performance any way.
Kindly let us know if you need any further assistance.
Have a nice day.
Best regards,
Madhan