Hello ,
I am trying to add the following column through the codebehind.
ComboBoxColumn comboBoxColumn = new ComboBoxColumn();comboBoxColumn.ItemsSource = (IEnumerable) property.GetValue(applicationLookupProvider, null);comboBoxColumn.HeaderText = savedLoanTemplateField.Name;comboBoxColumn.Key = savedLoanTemplateField.Name;comboBoxColumn.DisplayMemberPath = lookupAttribute.DisplayMemberPath;comboBoxColumn.SelectedValuePath = lookupAttribute.SelectedValuePath;
loansGrid.Columns.Add(comboBoxColumn);
It properly adds the column but all the dropdown values are set to blank. It does not show the properly selectedValuePath in the dropdown. I am using reflection to add bind the ItemSource and when I set the breakpoint the IEnumerable list is getting set.
Please advise.
Pawan
I tried to move the creation of the column out of the Loaded event handler and put in Button Click event handler and I couldn't reproduce the issue.
I don't know of any issue with MVVM and Prism that might cause such an issue.
Could you please try to put together a sample app where the issue is reproducible so I could be able to help?
Regards,
Also the actual creation of the columns does not happen on form load it occurs after an event occurs once the application has been fully loaded. We are using MVVM with Prism. Any issues with using that?
Hi,
Thank you for getting back to me. I am still having the issue with the grid not defaulting the grid values. Your sample seems to be working I am not sure why I am not getting the same result in my application.
I am using version 11.1.20111.1004. I am not getting a binding error in the output window but I am getting an 'Argument types do not match' when I try to use the filter of the column header. In the filter drop down the values are getting displayed correctly,.
I did verify that the DisplayMemberPath and the SelectedValuePaths are correct.
Hi Pawan,
I was not able to reproduce the issue you are referring to
I have attached the sample solution I used while trying to reproduce the issue.
You could check if the values you provide to DisplayMemberPath and SelectedValuePath are correct. If they are not you should get some binding errors in the output window of VS.
If this is not the case it will be good to provide the build numbers of the assemblies you use and modify the sample solution so the issue is easily reproducible.
HTH,