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
640
Bind a ComboBox to a List of the Current DataItem
posted

Hi there,

we have a problem with binding a collection to a combobox in the XamDataGrid (in C# code).

The XamDataGrid is populated with SalesLines. Each SalesLine has a IENumerable property. This list is different each salesLine. The active salesline (dataItem) ComboBox has to be populated with the IENumerable list of different units.

For example:

Record 1: SalesLine "Product 1" has to have a ComboBox with values ("pc","Box","Crate")

Record 2: SalesLine "Product 2" has to have a ComboBox with values ("m","cm","mm")

In our project we see the ItemsSource filled but the ComboBox displays an empty list.

 

Can you please provide us an example how we can achieve this in code (not in XAML).

Thank you very much.