View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001809 | NoesisGUI | C++ SDK | public | 2020-10-14 21:54 | 2020-10-19 10:53 |
| Reporter | steveh | Assigned To | sfernandez | ||
| Priority | normal | Severity | minor | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.0.6 | ||||
| Target Version | 3.0.7 | Fixed in Version | 3.0.7 | ||
| Summary | 0001809: Selector doesn't synchonise selected index correctly | ||||
| Description | HI guys, I've recently updated to 3.0.6 from 3.0.0 and I'm experiencing a new issue. I have a listbox with ItemsSource bound to an ObservableCollection in code. The XAML binds the SelectedValue to an entry which is set up in the constructor of the data context. class MyLeafObject{} class MyStruct class MyDataContext <ListBox x:Name="MyParentLB" ItemsSource="{Binding Entries}" SelectedValue="{Binding Path=CurrentStruct, Mode=TwoWay}" /> This all worked in 3.0.0. When the item container generator generated the listboxitems, it correctly applied the selected state to the entry we set in MyDataContext::MyDataContext. Since updating to 3.0.6, this no longer happens. From what I can see, the Selector::SelectedIndex / Selector::SelectedValue are correct, but the Selector::mSelectedIndices array never gets populated. I've trace it through the following callstack:
if (!sync.HasValue()) The ItemsSource is not a CollectionView object, so "if (cv != 0)" does not succeed. So the ItemsSource all looks good, the dependency property code is all bound / initialise correctly, but none of the properties syncrhonise the mSelectedIndices array. So when we finally get around to generating the containers:
It bails out here:
The condition fails because isSelected returns false. itemIndex is correctly set to 0, the container is set to our correct ListBoxItem, and GetIsSelected(ListBoxItem) returns false. If mSelectedIndices contained my selected index at this point everything should work fine. Any idea how I can go about fixing this? I can manually call "->SetSelectedIndex(0)" when the containers are generated, but this just feels like a hack, the bindings should update the selected property ideally. Sorry for the wall of text, Cheers, -Steven | ||||
| Platform | Any | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-10-14 21:54 | steveh | New Issue | |
| 2020-10-14 21:54 | steveh | Description Updated | |
| 2020-10-14 21:56 | jsantos | Target Version | => 3.0.7 |
| 2020-10-14 21:56 | jsantos | Assigned To | => sfernandez |
| 2020-10-14 21:56 | jsantos | Status | new => assigned |
| 2020-10-16 11:45 | sfernandez | Note Added: 0006683 | |
| 2020-10-19 10:53 | sfernandez | Status | assigned => resolved |
| 2020-10-19 10:53 | sfernandez | Resolution | open => fixed |
| 2020-10-19 10:53 | sfernandez | Fixed in Version | => 3.0.7 |
| 2020-10-19 10:53 | sfernandez | Note Added: 0006695 |