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

Commented Unassigned: how to use CheckComboBox with mvvm [20766]

$
0
0
hi
I am using the CheckComboBox ver 2.0.0 in my wpf mvvm project
but I seem unable to bind the selecteditems. when Bind selecteditems to a property in wpf exception errror
SelectedItems="{Binding SelectedItemAccountUnitGroup }
error:
'SelectedItems' property is read-only and cannot be set from markup. Line

how to save All checked items CheckComboBox to database?

i am using EF code First And Mvvm


but only one checked item CheckComboBox save to database

__this is my code__
__binding in wpf window:__
```
<xceedtoolkit:CheckComboBox Grid.Row="2" Grid.Column="3" Name="xccedcheck"
ItemsSource="{Binding AccountUnitGroupList }"
DisplayMemberPath="AccUnitGroupName"
ValueMemberPath="AccUnitGroupID"
SelectedValue="{Binding AccountUnitData.AccUnitGroupID}"
SelectedMemberPath="{Binding SelectedItemAccountUnitGroup, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

IsDropDownOpen="false"
MaxDropDownHeight="100">
```

i am using
```
SelectedValue="{Binding AccountUnitData.AccUnitGroupID}"

```
to save to database but this metod only one checked item save


viewmodel:

```
public AccountUnit AccountUnitData { get; set; } //this field for new Instance of my model in view model

public ObservableCollection<AccountUnitGroup> AccountUnitGroupList { get; set; }//this list load mylist to CheckComboBox

private AccountUnitGroup _selectedItemAccountUnitGroup;

public AccountUnitGroup SelectedItemAccountUnitGroup // this field for binding to SelectedItem or SelectedItems
{
get { return _selectedItemAccountUnitGroup; }
set
{
if (_selectedItemAccountUnitGroup != value)
{
_selectedItemAccountUnitGroup = value;

NotifyPropertyChanged("SelectedItemAccountUnitGroup");
}
}
}

```

please help me by sample with mvvm

thanks
Comments: ** Comment from web user: BoucherS **

Hi,

Can you submit a more complete sample ? I'm having errors trying to build something from the code you pasted.
Have you tried with PropertyGrid.SelectedItemsOverride property ?


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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