Hi Leclerc,
We suspect that you want to bind the complex objects in a column and bind the combobox SelectedItem based on the object. We have prepared the sample based on this and please find the sample from the below location,
<syncfusion:GridTemplateColumn Width="140"
HeaderText="Customers.City"
MappingName="Customers" >
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Customers.City}"/>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}},
Path=DataContext.CompanyItems}" SelectedItem="{Binding Path=Customers.City}" />
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn> |
In the above sample, we have a combobox’s ItemsSource in a viewmodel and bind the SelectedItem based on the complex property.
If we misunderstood your requirement, please share the more details about your requirement? This would be more helpful for us to analyze further.
Regards,
Jai Ganesh S