Runtime ComboBox column Binding

Nov 5, 2008 at 9:44 PM

Hi, I'm trying to populate my DataGridComboBoxColumn runtime:

_custTypesList = BusinessLogic.

CustTypesBL.getCustTypes();

 

 

DataGridComboBoxColumn dgc = new DataGridComboBoxColumn();

 

 

DataTable dtTypes = ResQ.Converters.DataTableConverter.GetDataTableNative(_custTypesList);

 

dgc.ItemsSource = dtTypes.AsEnumerable();

dgc.TextBinding =

new Binding(c.ColumnName);

 

dgCustomers.Columns.Add(dgc);

This doesn't work. I suspect it's because I can't setup an ItemSource to the whole datatable. So, how I can map it to just a single column from this DataTable?

Any help is appreciated.

Coordinator
Nov 5, 2008 at 10:25 PM
You may want to try setting the ItemsSource to dtTypes.DefaultView.  Does that help at all?
Nov 5, 2008 at 10:33 PM
Nope, same result...
Coordinator
Nov 6, 2008 at 2:46 PM
What about it doesn't work?  The combobox doesn't populate?
Nov 6, 2008 at 8:28 PM
I solved this. Thanks.
Nov 20, 2008 at 2:48 AM
Wish you had said how!