Question : c# dataview as a binding source

I have a common DataTable that i vish to display in various different ways in different datagridviews. It would appear that the best way is to use separate dataviews based on the datatable for each binding source for each DGV.

What I need to know is how to get the data table column names from the binding source

if the binding source is a datatable the following works

foreach (DataColumn Col in (cmbMCCB.Binding.DataSource as DataTable).Columns)

If the binding source is a dataview this does not work nor does

foreach (DataColumn Col in (cmbMCCB.Binding.DataSource as DataView)[0].Row.Table.Columns)

Any ideas

Answer : c# dataview as a binding source

Random Solutions  
 
programming4us programming4us