Home:ALL Converter>WinForms setup DataGridView with one column bound to List

WinForms setup DataGridView with one column bound to List

Ask Time:2013-05-10T02:45:12         Author:user1002479

Json Formatter

I'm using C# 4.0 and WinForms. I'm trying to get my DataGridView to be setup like this

[CheckBox]  [TextColumn]  [ComboBoxColumn]

This is for a menu similar to the SQL Server Import/Export tool. The checkbox will tell me whether the table is to be transferred. TextColumn is the source table name. And ComboBoxColumn is a list of the tables in the destination database.

Example

[Transfer]  [SourceTable]  [DestinationTable]
    X       MyTableSource  MyTableDest

Where MyTableDest would be a list I could choose from like (TableA, TableB, TableC), or I could input my own name.

I tried this.dataGridView.DataSource = myBindingList where mybindingList has my custom object that looks like

public class Mine {
   public bool Transfer { get; set;}
   public string Source { get; set;}
   public List<string> Destination { get; set; }
}

I don't need a full solution - just direction on how to achieve this

Author:user1002479,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16468890/winforms-setup-datagridview-with-one-column-bound-to-list
yy