I get an exception NullReferenceException in QueryNextEnabledCell method when I use keyboard keys Left or Up to move the current cell left or up and there are only cells with Enabled==false left or above of it.
My grid is virtual, I use event handlers for QueryColCount, QueryRowCount, QueryCellInfo, SaveCellInfo and QueryCoveredRange.
As I have no source code, I cannot find the reason and workaround for that. I believe I have to set some other property on my disabled cells to avoid crash in QueryNextEnabledCell.
Could you give me an idea, what can cause that exception in QueryNextEnabledCell ? I've attached the stack info as file. At that moment the current cell was on column 6, I pressed left. Columns 1 to 5 have Enabled=false.
Thanks for hints.
ADAdministrator Syncfusion Team July 18, 2003 03:23 AM
Here is the code.
while (targetCol >= 1 && !enabled)
// skip invisible and covered cells
while (targetCol >= 1
&& (grid.GetColWidth(targetCol) == 0
|| gridModel.CoveredRanges.Find(targetRow, targetCol, out coveredRange)
&& coveredRange.Left != targetCol
if (targetCol >= 1)
gridModel.CoveredRanges.Find(targetRow, targetCol, out coveredRange);
style = grid.GetViewStyleInfo(coveredRange.Top, coveredRange.Left);
enabled = style.Enabled || grid.IsDesignMode();
// not enabled, continue search
if (!enabled && targetCol >= 1)
So, it does rely on covered cells heavily. If you can attach a sample project, or submit a Direct Trac support incident with a sample, we can see if we can spot something here.
JHJan HornychJuly 18, 2003 05:21 AM
Thanks, it helped. My mistake was setting e.Range=null;e.Handled=true; in QueryCoveredRange event handler in case no covering was applicable for the cell. After change only to e.Handled=false; in this case, everything works fine.
Thank you once more.