ListView.Items[x].Selected not working on Cocoa with MultiSelect = true
Original Reporter info from Mantis: LazProgger
-
Reporter name:
Original Reporter info from Mantis: LazProgger
- Reporter name:
Description:
When you have a ListView with MultiSelect = true, the .Selected property of the items is not working correctly. Most times the result is always false, even when the Item is selected. Sometimes it is giving true, but that seems to be appearing randomly.
If MultiSelect is set to false .Selected seems to give the right results.
Steps to reproduce:
I have attached an example project. Select an Item in the ListView, click on "Show Selected" and see the result.
The following code is used in the example:
procedure TForm1.bt_show_selectedClick(Sender: TObject);
var
i: integer;
s: string;
begin
s := '';
for i := 0 to lv.Items.Count - 1 do begin
s += 'Item '+inttostr(i)+': ' + BoolToStr(lv.Items[i].Selected, 'selected', 'not selected') + LineEnding;
end;
ShowMessage(s);
end;
Mantis conversion info:
- Mantis ID: 36074
- OS: macOS
- OS Build: Sierra
- Platform: Cocoa
- Version: 2.0.4
- Fixed in revision: 62157 (#4d3b324f)