Hi all,
i am using wpf(mvvm).actually i have a combobox, this combobox selecting one item only and this combox able to edit to search the items. i need multipleselect items and edit to search items in combobox.
now i am using code is in View
<StackPanel HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" Width="227">
<ComboBox Name="cRegionFilter" Text="{Binding ComboText}" StaysOpenOnEdit="True" IsEditable="True" SelectedItem="{Binding SelectedRegion}" DisplayMemberPath="RegionCd" SelectedIndex="{Binding ClearSelection}" SelectedValuePath="RegionCd" ItemsSource="{Binding FilterRegionName,Mode=TwoWay}" Grid.Column="3" Margin="0,0,0,0" Grid.RowSpan="2" Height="30" Width="100" HorizontalAlignment="Left"></ComboBox>
</StackPanel>
view model
private List<CustomerMgmt> _filterRegionName;
_filterRegionName = new List<CustomerMgmt>();
public List<CustomerMgmt> FilterRegionName{
get { return _filterRegionName; }
set
{
_filterRegionName = value;
RaisePropertyChanged("FilterRegionName");
}
} private void LoadRegionComboBox()
{
if (CustDisplay != null)
{
if (CustDisplay.CustomerCountry != null)
{
var custRegion = (from list in CustDisplay.CustomerCountry select list.RegionCode).Distinct().ToList();
var filteredList = (from list in custRegion select new CustomerMgmt { RegionCd = list });
if (FilterRegionName != null) FilterRegionName.Clear();
FilterRegionName = filteredList.OrderBy(x => x.RegionCd).ToList();
}
}
}