Home » Community » Newbie corner » tracking GridCtrl selection
Re: tracking GridCtrl selection [message #32765 is a reply to message #32709] |
Tue, 07 June 2011 08:21   |
|
You can iterate over all cells:
for(int i = 0; i < grid.GetCount(); i++)
for(int j = 0; j < grid.GetColumnCount(); j++)
{
if(grid.IsSelected(i, j))
{
... do anything ...
}
}
for checking rows only or you can use this macro
FOREACH_SELECTED_ROW(grid)
{
PromptOK(Format("Selected row: %d", grid.GetCurrentRow()));
... do my code...
}
As you noticed you can also retrieve number of selected rows/cells:
int selectedRows = grid.GetSelectedCount();
int selectedCells = grid.GetSelectedItemsCount();
Quote: |
CTRL+LMB or a Shift+LMB selection (they differ by 1)
|
Thanks. I'll try to fix that.
There are no GetSelectionBegin/End() methods (what should they return if there are multiple selections?)
|
|
|
Goto Forum:
Current Time: Fri Jul 18 23:06:49 CEST 2025
Total time taken to generate the page: 0.03206 seconds
|