```
<GridViewColumn Header="Surcharges">
<GridViewColumn.CellTemplate>
<DataTemplate>
<et:CheckComboBox Delimiter=" " DisplayMemberPath="PalletNetworkSurchargeCode" ItemsSource="{Binding Path=SurchargeOptions}" MinWidth="100" SelectedValue="{Binding Path=Surcharges}" ValueMemberPath="PalletNetworkSurchargeCode" Width="100" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
```
Within the View Model, SurchargeOptions is a List<PalletNetworkSurcharge>, PalletNetworkSurcharge.PalletNetworkSurchargeCode is a String, and SurchargeOptions is also a String.
If the user scrolls the list (quickly), or resizes the form in such a way that one or more items in the list is no longer visible, when that item is made visible again (either by more scrolling or more resizing) any items selected in the CheckComboBox are no longer selected and the clearing of the selected items is also reflected in the bound "SelectedValue".
Can you please help. Am I missing something within the Xaml or is there a problem with the control?
Thanks.
Martin.
Comments: ** Comment from web user: BoucherS **
Hi,
Thanks for the sample.
The ListView is using Virtualization to remove controls that are not displayed. In this case, checkComboBoxes will not be visible as the window size is getting smaller. When this is done, any selection is removed and via Binding, ListItemViewModel.Surcharges is being set to "".
When the window is going back to its original size, the CheckComboBoxes becomes in view. At that moment, they are recreated, and their SelectedValue is set (via Binding) to ListItemViewModel.Surcharges, which is "". This is why the selection is lost.
What you want is keep the selection while the CheckComboBox is not visible during virtualization.
As you found out, you can set VirtualizingPanel.IsVirtualizing="False" on the ListView so the CheckBoxes won't be removed, but it could affect performance.
You could use a OneWay binding to not modify the original SelectedValue :
```
SelectedValue="{Binding Path=Surcharges, Mode=OneWay}"
```
Or you could modify the code in file : Xceed.Wpf.Toolkit/Primitives.Selector.cs
In method : OnItemsSourceChangedOnItemsSourceChanged( IEnumerable oldValue, IEnumerable newValue )
Replace
```
this.RemoveUnavailableSelectedItems();
```
with
```
if( !VirtualizingStackPanel.GetIsVirtualizing( this )
|| (VirtualizingStackPanel.GetIsVirtualizing( this ) && (newValue != null)) )
{
this.RemoveUnavailableSelectedItems();
}
```
It will not set the selection to "" when the source becomes null while in virtualization mode.