views:

793

answers:

1

How to add unbound check box column to databound DataGrid (WinForms .NET 1.0, 1.1)?

I cannot add fake column to the data source because it is data view coming from elsewhere.

A: 

Why not adding the a checkbox column after you bound the datasource?

 // do this after changing dataGridView1.DataSource
 DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();
 checkBoxColumn.HeaderText = "Selected";
 dataGridView1.Columns.Add(checkBoxColumn);
Peter Gfader