break
Jun 2

I was trying to have a datagridview with a column that has a checkbox.

This is how I did it:

DataGridViewCheckBoxColumn ckbLotsOf = new DataGridViewCheckBoxColumn();
ckbLotsOf.Name = "chkLotsOf";
ckbLotsOf.HeaderText = "Lots of";
ckbLotsOf.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
dataGrid.Columns.Add(ckbLotsOf);

DataGridViewCheckBoxColumn creates the column with a checkbox. Your column needs a name, the text of the header of the column, autosize the column so it doesn’t take too much space, and then just add the column to the datagrid.

May 17
May 10

Next Entries »