ListBox selection doesn't update when items are added or removed. #19238
Replies: 3 comments 1 reply
-
Please use Discussions for questions or join us on Telegram. Thank you |
Beta Was this translation helpful? Give feedback.
-
I don't see where you even select a new item in code. Also use only one way to select an item, not all 3.possible ways. This will conflict with each other. |
Beta Was this translation helpful? Give feedback.
-
@timunie is there documentation on how to do multi/always selection? I didn't see any. I assumed listbox handled selection automatically when we add and remove items to it. Handling it manually is a big pain. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I have this code here...
and this axaml here...
when I click the + button it should find the last selected item index in the items source and select it.
when I click the - button it should select the item before the first item in the selection.
To Reproduce
Expected behavior
SelectedItems, SelectedItem and SelectedIndex should all update.
Avalonia version
11.3.2
OS
Linux
Additional context
I have been fighting with this for 2 days.
I can't figure out how to get it to work in all cases.
It should work regardless of what selection mode we use.
Beta Was this translation helpful? Give feedback.
All reactions