QueryCellStyleInfo called twice for same row

I have the following snippet in my form. However, I noticed that QueryCellStyleInfo is called twice for the same summary row.

if (el is GridSummaryRow)
{


GridSummaryColumnDescriptor sdd = e.TableCellIdentity.Table.TableDescriptor.SummaryRows["SummaryRowCaption"].GetSummaryColumnAtCol(e.Style.TableCellIdentity.ColIndex);
if (sdd != null)
{
SummaryDescriptor sdd1 =sdd.SummaryDescriptor;
string c = sdd.DisplayColumn;

if (sdd1 != null)
{
int indexOfSd = this.gridGroupingControl.Table.TableDescriptor.Summaries.IndexOf(sdd1);
Int32AggregateSummary summary1 = (Int32AggregateSummary)e.TableCellIdentity.DisplayElement.ParentGroup.GetSummaries(table)[indexOfSd1];
e.Style.Text = string.Format("{0:n}", summary1.Sum);

}

}
}

1 Reply

AD Administrator Syncfusion Team September 19, 2006 07:17 AM UTC

Hi James,

The QueryCellStyleInfo is called whenever the grid needs a cell style for any reason. It should not be called for every cell if only one cell is changed from code. But if you move your mouse over the grid, it will be called as the mouse moves (the grid needs the cell style to do hittesting). Or, if you call Refresh or Invalidate then QueryCellIStylenfo would be hit more.

Let me know if this helps.
Best Regards,
Haneef

Loader.
Up arrow icon