Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: CheckComboBox loses values when scrolled out of view [21917]

$
0
0
I am using a CheckComboBox within a ListView/GridView column, defined as follows...
```
<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,

Can you submit a complete sample to reproduce the issue. Also, which version of the Toolkit and Windows are you using ? Here's my small sample that looks good.
```
<Grid>
<ListView x:Name="_listBox">
<ListView.View>
<GridView>
<GridViewColumn Header="Surcharges">
<GridViewColumn.CellTemplate>
<DataTemplate>
<et:CheckComboBox Delimiter=" "
DisplayMemberPath="PalletNetworkSurchargeCode"
ItemsSource="{Binding SurchargeOptions}"
MinWidth="100"
SelectedValue="{Binding Path=Surcharges}"
ValueMemberPath="PalletNetworkSurchargeCode"
Width="100" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();

_listBox.ItemsSource = new List<MyData>()
{
new MyData() { SurchargeOptions = new List<PalletNetworkSurcharge>()
{
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "AA"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "BB"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "CC"}
}, Surcharges = "AA" },
new MyData() { SurchargeOptions = new List<PalletNetworkSurcharge>()
{
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "DD"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "EE"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "FF"}
}, Surcharges = "EE" },
new MyData() { SurchargeOptions = new List<PalletNetworkSurcharge>()
{
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "GG"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "HH"},
new PalletNetworkSurcharge() { PalletNetworkSurchargeCode = "II"}
}, Surcharges = "II" },
};
}
}

public class MyData
{
public List<PalletNetworkSurcharge> SurchargeOptions
{
get;
set;
}

public string Surcharges
{
get;
set;
}
}

public class PalletNetworkSurcharge
{
public string PalletNetworkSurchargeCode
{
get;
set;
}
}
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>