Using WPF XamDataGrid 12.1, .NET 4.5, I have a XamDataGrid that contains engineering values. In the header of each column, I have a XamComboBox where the user can select the units to display the value in, ie: feet, meters, or psi,Pa, Mpa, etc.
I've styled the LabelPresenter to contain the XamComboBox, and all works well IF I add the combo box items manually via the XamComboBoxItemsProvider XAML construct, but I cannot get the XamComboBox to bind to an ObservableCollection via the ItemsSource property.
What am I doing wrong? Any examples?
Hello.
1. In this example how do I capture a selected value from the combobox?
2. My XamDataGrid ItemsSource is Datatable. Can I bind the selected value to DataColumn Caption?
Thanks,Max
Hello Michael,
I am just checking your progress on the issue. Please do not hesitate to let me know if you have any further questions on the mater.
Thank you for your post. I have been looking into it and have created a small sample for you, named ComboInLabelPresenter. In the sample I set a style for the LabelPresenter and set the xamComboEditor as template for the presenter. Then I bind the combo to the ObservableCollection, that is source for the grid. I have a different style for each field, since the label is different for every column. If you want to display same values for the labels you can move the style to the resources of the window. Please find the attached sample and feel free to let me know if you have any further questions on the mater.