Posted 16 years ago
by David Mullin
Version: 4.5.0480
Platform: .NET 3.5
Environment: Windows Vista (32-bit)

I have a listbox sitting on top of a DeferrableObservableCollection, like this:
I have things wired up so that, when the user types in the TextBox of a ListBoxItem, an event is raised which results in adding an empty item to the DeferrableObservableCollection. If I just add it to the list, everything works. If I called BeginUpdate/EndUpdate, however, the currently active TextBox control loses focus and the focus goes nowhere.
I have a reproduction of this scenario, if that will help you.
<ListBox Grid.Row="1" ItemsSource="{Binding Path=DeferrableList}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0">Label</Label>
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I have a reproduction of this scenario, if that will help you.