I’ve inserted a checkbox column and textbox column on the datagridview.
how can add rows manually on the textbox column.
It should be like this:
checkbox | textbox
............................
checkbox | item1
checkbox | item2
checkbox | item3
checkbox | item4
Here is the code for checkbox and textbox on datagridview
public void loadgrid()
{
DataGridViewCheckBoxColumn checkboxColumn = new DataGridViewCheckBoxColumn();
CheckBox chk = new CheckBox();
checkboxColumn.Width = 25;
dataGridView1.Columns.Add(checkboxColumn);
DataGridViewTextBoxColumn textboxcolumn = new DataGridViewTextBoxColumn();
TextBox txt = new TextBox();
textboxcolumn.Width = 150;
dataGridView1.Columns.Add(textboxcolumn);
}
You can pass an object array that contains the values which should be inserted into the
DataGridViewin the order how the columns are added. For instance you could use this:And you can build object array from whatever you want, just be sure to match the type (i.e. use bool for checkedColumn)