Это мой код для моей DxGrid:
<dxg:GridControl x:Name="gridControlItemsDistinct"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Height="Auto" Width="Auto"
AutoPopulateColumns="False"
DataSource="{Binding Path=ChaseListHelperClassItemsList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="CreativeContactID" Header="Creative Contact Name" Width="90" FilterPopupMode="CheckedList" AllowEditing="True">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings Name="cboCreativeContact"
DisplayMember="ContactName"
AutoComplete="True"
ValueMember="ContactID"
ItemsSource="{Binding Path=Data.CreativeAgContactList, UpdateSourceTrigger=PropertyChanged}" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="{x:Type dxg:CellContentPresenter}">
<Setter Property="Background" Value="#FFE8F2F3" />
<Setter Property="TextBlock.Foreground" Value="Black" />
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
</dxg:GridControl.Columns>
Как видите, моя сетка привязывается к ChaseListHelperClassItemsList
:
public List<CreateChaseListHelperClass> ChaseListHelperClassItemsList
{
get
{
return chaseListHelperClassItemsList;
}
set
{
chaseListHelperClassItemsList = value;
OnPropertyChanged("ChaseListHelperClassItemsList");
}
}
CreateChaseListHelperClass:
public class CreateChaseListHelperClass
{
private int creativeContactID;
public int CreativeContactID
{
get;
set;
}
public IQueryable<Contacts> CreativeAgContactList
{
get;
}
}
Мой вопрос: как мне связать cboCreativeContact
ItemSource со списком внутри моего CreateChaseListHelperClass
, CreativeAgContactList
.
Моя текущая привязка выглядит следующим образом:
ItemsSource="{Binding Path=Data.CreativeAgContactList, UpdateSourceTrigger=PropertyChanged}"
Мой DataContext установлен в моем представлении:
DataContact = ChaseListViewModel
Итак, структура
ChaseListViewModel-CreateChaseListHelperClassList-CreativeAgContactList
Я хочу установить CreateAgContactList
какItemSource
на моем ComboBox