DataGridComboBoxColumn - TextBlock is empty

Oct 2, 2008 at 11:43 AM
When manually creating ComboBox columns in code and binding them to custom reference types - they do not have any display when not in edit-mode.

When in editmode they display correctly.

How do I create a CellStyle in code to bind to the ToString() of the object?
Oct 2, 2008 at 12:31 PM
Could you provide a code snippet of your DataGridComboBoxColumn.
Oct 2, 2008 at 12:47 PM
public class Order
public Customer{get;set;}
public class Customer
public string Name{get;set;}
public override string ToString()
return Name;

            var _column = new DataGridComboBoxColumn();
            _column.Header = "Customer";
            var dataFieldBinding = new Binding("Customer");
            dataFieldBinding.Mode = BindingMode.TwoWay;
            _column.DataFieldBinding = dataFieldBinding;

            _column.ItemsSource = //some list of Customers

Oct 2, 2008 at 2:00 PM
DataFieldTarget may help.  For more information on DataGridComboBoxColumn usage see these blog posts, and
Oct 2, 2008 at 6:40 PM
DataFieldTarget may have helped if I had been binding to a property on Customer - but here I'm binding to the object it self. I guess I have to create a DataTemplate instead.

Thanks for your time anyhow.