What version of our DLL''s are you using?
In the grid\samples\quickstatr\virtualgrid sample, I add a button to the form with this handler.
bool showDebug = false;
Random r = new Random();
private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("Start");
showDebug = true;
this.gridControl1.RefreshRange(GridRangeInfo.Cell(r.Next(5) + 1, 4));
Console.WriteLine("End");
showDebug = false;
}
I then add this if at the top of GridQueryCellInfo.
if(this.showDebug)
Console.WriteLine("GridQueryCellInfo {0},{1}", e.RowIndex, e.ColIndex);
Here is what I see when I run this on the output page when I run the sample in the debugger with 3010.
Start
GridQueryCellInfo 1,4
GridQueryCellInfo 1,-1
GridQueryCellInfo -1,4
GridQueryCellInfo -1,-1
End
First, the cellstyle for 1,4 is gotten, then the rowstyle, then the colstyle and finally the tablestyle. So, if you checked for e.RowIndex > 0 and e.ColIndex > 0, then your code would be hit once due to the grid.RefreshRange call.
But QueryCellInfo will be triggerred just by moving your mouse over the grid. (You can see this with the above code by commenting out the if-statement so the WriteLine is always hit in the GridQueryCellInfo.) The grid needs the style under the mouse to do appropriate hittesting, etc base on the style of the cell. So, you may be seeing these hits as opposed to teh hits due to explicit calls to RefreshRange. Now earlier versions did have some problems with refreshing too much, but I think they have been resolved since 2.1.0.9 (?).
In this 3010 sample, Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\Performance\OneTimeOnlyQueryCellInfo, there is a technique that shows how you can have a grid where QueryCellInfo is only hit once. This might be of interest to you.