Hi,
I have a datagridview with three columns : the first column is an editText box , the second and the third column are a comboboxcolumn of enum.
when i run the code, by default the first row is displayed with all fields are empty.
but the problem come when i click to the first cell (TextBox), the two other combobox cell take automatically their default values. but i don't want them to take any value unless i select it by myself.
is there any way to do it ?
for info the datasource of the datagridview is linked to a list.
thanks,
What I have tried:
private void dgv_TableTarification_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
return;
if (e.ColumnIndex < 0)
return;
if (this.dgv_TableTarification.CurrentCell.ColumnIndex == 0)
{
this.dgv_TableTarification.Rows[e.ColumnIndex].Cells["C_Tarif"].Selected = false;
this.dgv_TableTarification.Rows[e.ColumnIndex].Cells["C_RELAIS"].Selected = false;
}
}
private void dgv_TableTarification_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{
e.Row.Cells["C_Tarif"].Value = string.Empty;
e.Row.Cells["C_RELAIS"].Value = string.Empty;
}