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 Go to previous message
Maginor is currently offline  Maginor
Messages: 44
Registered: May 2019
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?

 
Read Message
Read Message
Read Message
Previous Topic: ArrayCtrl::Paint is called three times
Next Topic: Restore original row order
Goto Forum:
  


Current Time: Fri Mar 29 14:45:04 CET 2024

Total time taken to generate the page: 0.01189 seconds