pvphuc

I am using DataGridViewCheckBoxCell but I can not set CheckState of the CheckBox because it is not exists.

Please tell me how I can do that.

Thanks in advance.

Best Regards,

pvphuc



Re: Windows Forms General How can I set CheckState of DataGridViewCheckBoxCell ?

element109

Code Snippet

Me.dgvMain.Item(0, 0).Value = True





Re: Windows Forms General How can I set CheckState of DataGridViewCheckBoxCell ?

pvphuc

Thanks element109.
I mean how I can access the CheckState property to set or get its value (3 state of the checkBox)





Re: Windows Forms General How can I set CheckState of DataGridViewCheckBoxCell ?

Tharmapalan

Hi pvphuc

I thing u wanted to find the status of the check box while check check box let's do as follow

datagridviewcheckboxcolumns column=new datagridviewcheckboxcolumns();

column.name="check";

column.valuetype=typeof(bool)

datagriedview.columns.add(column);

where the a column been as checkbox and valuetype declare as boolean after that fill value as like

foreach(datarow dr in dataset.table[0].rows)

{

datagrieview.rows.add(false); //here value was assigned as false hence initialize all value to be unchecked

}

so when u click the check box its changes status to True .hence u can find the row which was checked it.