Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » [Bug]ArrayCtrl,MultiSelect.In WhenSel callback, selection status of last selected row is incorrect
[Bug]ArrayCtrl,MultiSelect.In WhenSel callback, selection status of last selected row is incorrect [message #51750] Mon, 13 May 2019 15:53
Maginor is currently offline  Maginor
Messages: 3
Registered: May 2019
Junior Member
Hi, I have an ArrayCtrl A with MultiSelect enabled.
I use the WhenSel callback to get notified when the selection status changes.

Inside my callback function I do

int RowCount = A.GetCount();
	
for(int Row = 0; Row < RowCount; ++Row)
{
    if(A.IsSelected(Row)) 
    {
        //Do something
    }
}


This works fine if there is only one row selected, but if there are multiple, IsSelected() returns false for the latest row that was selected.

I could also check if the row is the cursor (which works), but that will not give the desired behaviour when the cursor is on a deselected row (which it for instance is if you ctrl-click to deselect something).

Alternatively, is there a better way to iterate over the selected rows than I do here?

Previous Topic: ArrayCtrl::Paint is called three times
Goto Forum:
  


Current Time: Sun May 26 13:09:01 CEST 2019

Total time taken to generate the page: 0.00760 seconds