I am using an iGrid in rowmode, and want to display the number of rows currently selected.

I check in the CellSelectionChange event, and am inspecting the grid.selitems.Count, but sometimes it is correct, other times it does not change.


But maybe I am missing something, or there is another place to check that is better?


UPDATE: Maybe I should be using the .AfterSelectionChange event, that seems to be working better. I will continue testing.
Indeed, you need to count the selected rows in the AfterSelectionChange event. It is raised after the moment when iGrid finished changing the selection status of every cell involved into the current selection operation and updated the SelItems collection.

The CellSelectionChange event occurs every time when ONE CELL changes its selection status. When you select/deselect whole rows, the selection status of the corresponding cells are changed by the internal iGrid logic, but iGrid does not guarantee that the SelItems property is updated accordingly with every cell selection change. In some cases it is much faster to update the SelItems property after iGrid has changed the selection status of all involved cell for faster performance.

Even if the SelItems property were in sync with every CellSelectionChange event, this event should not be used to solve your task because this event is raised many times during one selection operation. Actually you may get a lot of notifications about selection change during one selection operation, but only the last of them will report the correct number of selected rows.