Code for the comboboxes is as follows
<TextBlock>Status</TextBlock>
<ComboBox x:Name="CB_Status" ItemsSource="{Binding Status}" SelectedValuePath="StatusId" SelectedValue="{Binding CurrentCall.StatusId, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" ItemTemplate="{StaticResource StatusTemplate}" />
<TextBlock>Priority</TextBlock>
<ComboBox x:Name="CB_Priority" ItemsSource="{Binding Priorities}" SelectedValuePath="PriorityId" SelectedValue="{Binding CurrentCall.PriorityId, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" ItemTemplate="{StaticResource PriorityTemplate}"/>
<TextBlock>Issue Type</TextBlock>
<ComboBox x:Name="CB_IssueType" ItemsSource="{Binding IssueType}" SelectedValuePath="IssueTypeId" SelectedValue="{Binding CurrentCall.IssueTypeId, Mode=TwoWay,NotifyOnValidationError=True, ValidatesOnExceptions=True}" ItemTemplate="{StaticResource IssueTemplate}" />
The data is pulled from a VM, and the data is called using async calls at the start, and the variables are populated as follow:
private IEnumerable<Priority> _priorities;
public IEnumerable<Priority> Priorities
{
get { return _priorities; }
set
{
if (value != _priorities)
{
_priorities = value;
this.RaisePropertyChanged("Priorities");
}
}
}
private IEnumerable<Status> _status;
public IEnumerable<Status> Status
{
get { return _status; }
set
{
if (value != _status)
{
_status = value;
this.RaisePropertyChanged("Status");
}
}
}
private IEnumerable<IssueType> _issueType;
public IEnumerable<IssueType> IssueType
{
get { return _issueType; }
set
{
if (value != _issueType)
{
_issueType = value;
this.RaisePropertyChanged("IssueType");
}
}
}
so comboboxes are IEnumerable collections of various entities. The thing is upon sorting, the parent table, the combo boxes lose their selected value, but the data for the combobox remains intact. Via fiddler I can see that there arent any subsequent calls to fetch the data for the comboboxes.