I am using Visual Studio 2005 , C#.
I have a datagridview with bind to a datasource, I have added three
unbound Gridviewcheckedbox column in this gridview, I want that at run
time these checked box work like a radio button, and at the run time when I click on any checked box all others checked box should be un-checked.
I have tried, but not success to do it, in the bellow code at the run time when I click 2nd time on any checked box, first checked box is not been un-checked.
How should I do this.
My Code is her:
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) |
Vishal JadavPosted Aug 2, 2010, 3:47 AM
Try setting datagridviewcheckbox column like,
true value to 1
false value to 0
and nondeterminate value to 2
then apply those values in condition like
if(datagridviewcheckboxcolumn[i].value == 1)
{
then procedure for TRUE
}
elseif(datagridviewcheckboxcolumn[i].value == 0 || datagridviewcheckboxcolumn[i].value == 2)
{
the procedure for FASLSE
}
Because datagridviewcheckbox column contains 3 values for it. When loads and if not checked then its value is false and when u check and uncheck again then its value is undeterminated state..
Its better way to putting user defined values in its property dialog box..
Hope it will help.
Be frank to ask if any problem.