Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Adding Combobox Columns Dynamically to XAMGrid
posted

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