To Call Cell Text Changed Event in DataGridView using C#

Posted by T.saravanan under Windows Forms category on | Points: 40 | Views : 37496
Hi All,

Here i am given a code snippet for how to call (or) use text changed event in DataGridView Control.
In my form i am using DataGridView and TextBox Controls in a form.
This Code explain to set a Cell value into TextBox.

// Assign Control Object(declared as Global)
Control cntObject;

// Select DataGridView EditingControlShowing Event
Private void datagridview_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
e.Control.TextChanged +=new EventHandler(textBox_TextChanged);
cntObject.TextChanged +=textBox_TextChanged;

// TextBox TextChanged Event
Private void textBox_TextChanged(object sender, EventArgs e)

I hope this Code snippet very useful to who need a textchanged event in DataGridView Control.

Cheers :)

Comments or Responses

Login to post response