I have a DataGridView in which there are 3 columns; Quantity, Rate and Amount.
The DataGridView is Editable. When I enter a value in the Rate Column then immediately the val
I have found no event that can handle the value of cell change properly.
You must convert the editable cell into a Textbox, then provide the changed event on it.
This is the code that i found while browsing one of the MSDN Forums:
http://social.msdn.microsoft.com/Forums/windows/en-US/a56ac5c1-e71f-4a12-bbfa-ab8fc7b36f1c/datagridview-text-changed?forum=winformsdatacontrols
I am also adding the code here:
void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 0)
{
TextBox tb = (TextBox)e.Control;
tb.TextChanged += new EventHandler(tb_TextChanged);
}
}
void tb_TextChanged(object sender, EventArgs
{
MessageBox.Show("changed");
}