Adding rows on datagridview manually

后端 未结 2 1699
眼角桃花
眼角桃花 2021-01-18 05:18

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:

che         


        
2条回答
  •  心在旅途
    2021-01-18 05:40

    You can pass an object array that contains the values which should be inserted into the DataGridView in the order how the columns are added. For instance you could use this:

    dataGridView1.Rows.Add(new object[] { true, "string1" });
    dataGridView1.Rows.Add(new object[] { false, "string2" });
    

    And you can build object array from whatever you want, just be sure to match the type (i.e. use bool for checkedColumn)

提交回复
热议问题