This question is locked. New answers and comments are not allowed.
I spent hours reading forum and trying to code, but no...
I have a combobox in a grid, items to combo comes from separate domaindatasource than the grid. Data is showing in combo in the grid. But The proper item in combo is not selected (nothing is selected when grid is loaded). But if I double click on the combobox in a row, then I see the proper item in combo. So the values are there, just not "auto selected" when grid is loded.
I use RIA service.
What to I need to do, so the combobox show correct Item. And I also need to save the value if I change item in combo.
XAML (dds for the combobox items)
C#
I have a combobox in a grid, items to combo comes from separate domaindatasource than the grid. Data is showing in combo in the grid. But The proper item in combo is not selected (nothing is selected when grid is loaded). But if I double click on the combobox in a row, then I see the proper item in combo. So the values are there, just not "auto selected" when grid is loded.
I use RIA service.
What to I need to do, so the combobox show correct Item. And I also need to save the value if I change item in combo.
XAML (dds for the combobox items)
| <riaControls:DomainDataSource x:Name="DomainDataSourceCmb" AutoLoad="True" LoadSize="100" QueryName="GetSongcategoriesSet" LoadedData="DomainDataSourceCmb_LoadedData"> | |
| <riaControls:DomainDataSource.DomainContext> | |
| <ds:MediaContext/> | |
| </riaControls:DomainDataSource.DomainContext> | |
| </riaControls:DomainDataSource> |
C#
| private void DomainDataSourceCmb_LoadedData(object sender, LoadedDataEventArgs e) | |
| { | |
| ComboBoxEditorSettings comboBoxEditorSettings = new ComboBoxEditorSettings(); | |
| comboBoxEditorSettings.DisplayMemberPath = "longname"; | |
| comboBoxEditorSettings.SelectedValuePath = "guid"; | |
| comboBoxEditorSettings.ItemsSource = DomainDataSourceCmb.DataView; //.Data | |
| ((GridViewDataColumn)this.RadGridView1.Columns[5]).EditorSettings = comboBoxEditorSettings; | |
| } |