BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Emanuele,
We have checked with your sample . You have set DataContext as MainViewModel for Window. But it does not have AvilableTitles property which is binded for ComboBox ItemsSource. So you need to define the property in MainViewModel .
We have modified the sample based on your requirement and you can download it from below location.
Sample Location: SfDataGrid_Combobox1.zip
Please refer the below code snippet.
Code snippet[XAML]:
<sync:GridComboBoxColumn AllowEditing="True" HeaderText="Title" ItemsSource="{Binding Path=DataContext.AvailableTitles, ElementName=grid}" MappingName="SelectedTitle" /> |
Please let us know if you have any other queries,
Regards,
Saravanan.M
Hi Emanuele,
Please ignore our previous update,
You can set the ItemsSource for each row based on the Gender by using GridTemplateColumn, where we have loaded the TextBlock in CellTemplate and ComboBox in EditTemplate with ItemsSource binding as you requested. We have prepared a sample based on this and you can download it from below location
Sample Location: SfDataGrid_Combobox1.zip
Please refer the below code snippet
Code snippet[XAML]:
<sync:GridTemplateColumn HeaderText="Title" MappingName="SelectedTitle"> <sync:GridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Margin="2,0" Text="{Binding Path=SelectedTitle}" /> </DataTemplate> </sync:GridTemplateColumn.CellTemplate> <sync:GridTemplateColumn.EditTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding AvailableTitles}" SelectedValue="{Binding Path=SelectedTitle}" /> </DataTemplate> </sync:GridTemplateColumn.EditTemplate> </sync:GridTemplateColumn> |
Regards,
Saravanan.M
Hi Emanuele
Thanks for your update. Please let us know if you need further assistance .
Regards,
Saravanan.M