I have a RadComboBox in WPF that is set to allow for multiple selection. I can manually select multiple items and I can get the set of selected items but I can't figure out how to programmatically select multiple items. The value in the RadComboBox is bound to a DataTable with the value and text both being linked to the same column. Sample values for the data are (00, 01, 02, 03, 04, 05, 06, 07). How can I take a comma delimited string (example: "01, 03, 06") and select the those items from that string in the RadComboBox?
<DataTemplate x:Key="MultipleSelectionBoxTemplateDept">
<TextBlock Text="{Binding ElementName=cmbDept, Path=SelectedItems.Count, StringFormat='Selected Items Count: {0}'}" Foreground="Red" FontWeight="Bold" />
</DataTemplate>
<telerik:RadComboBox Name="cmbDept" AllowMultipleSelection="True" IsEditable="False" Width="250" Height="25" Margin="0,0,0,0" VerticalAlignment="Top" ItemsSource="{Binding}" MultipleSelectionBoxTemplate="{StaticResource MultipleSelectionBoxTemplateDept}" OpenDropDownOnFocus="True"></telerik:RadComboBox>
C# code:
cmbDept.DataContext = dtDeptList.DefaultView;
cmbDept.DisplayMemberPath = dtDeptList.Columns[0].ToString();
cmbDept.SelectedValuePath = dtLeadList.Columns[0].ToString();