M
Marco Pais
Hi there.
Hi have a datagridview with a textbox columns (prices) and a checkbox
column. I want that when a row is checked, some a value is incrmented with
the price colmun. Everything works fine, if I click chekbox cell slowly
(true-false-true-false...). However, if I click faster, it assumes always
true or false.
This is the code I'm using:
if (e.RowIndex > -1 && this.dgExtras.Columns[e.ColumnIndex] is
DataGridViewCheckBoxColumn)
{
dgExtras.EndEdit();
if (Convert.ToBoolean(dgExtras[e.ColumnIndex,
e.RowIndex].Value) == true)
extras += float.Parse(dgExtras[e.ColumnIndex - 1,
e.RowIndex].Value.ToString());
else
extras -= float.Parse(dgExtras[e.ColumnIndex - 1,
e.RowIndex].Value.ToString());
}
Any help would be apreciated. Thanks.
Regards.
Marco.
Hi have a datagridview with a textbox columns (prices) and a checkbox
column. I want that when a row is checked, some a value is incrmented with
the price colmun. Everything works fine, if I click chekbox cell slowly
(true-false-true-false...). However, if I click faster, it assumes always
true or false.
This is the code I'm using:
if (e.RowIndex > -1 && this.dgExtras.Columns[e.ColumnIndex] is
DataGridViewCheckBoxColumn)
{
dgExtras.EndEdit();
if (Convert.ToBoolean(dgExtras[e.ColumnIndex,
e.RowIndex].Value) == true)
extras += float.Parse(dgExtras[e.ColumnIndex - 1,
e.RowIndex].Value.ToString());
else
extras -= float.Parse(dgExtras[e.ColumnIndex - 1,
e.RowIndex].Value.ToString());
}
Any help would be apreciated. Thanks.
Regards.
Marco.