TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mahesh waghela
NA
93
114k
Event Not Fired On Editing Control Of Datagridview
Nov 14 2011 12:44 PM
There is strange problem I am facing that I have custome datagridview in my application and I am trying to fire even on Editing ControlShowing Event Of datagridview as below:
private void newdgv_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
TextBox tbox = e.Control as TextBox;
if (newdgv.CurrentCell.ColumnIndex == 0)
{
tbox.TextChanged+=new EventHandler(tbox_TextChanged);
tbox.KeyDown += new KeyEventHandler(tbox_KeyDown);
}
}
private void tbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
CashShortAC4 csa4 = new CashShortAC4();
csa4.Bt_Click += new CashShortAC4.CShortAC1(csa4_Bt_Click);
csa4.Show(this);
}
}
private void tbox_TextChanged(object sender, EventArgs e)
{
TextBox tbox = (TextBox)sender;
if (tbox.Text.Length > 2)
{
listBox2.Visible = true;
button2.Visible = true;
int inddex = listBox2.FindString(tbox.Text);
if (inddex != -1)
{
listBox2.SetSelected(inddex, true);
listBox2.Focus();
tbox.TextChanged -= new EventHandler(tbox_TextChanged);
}
}
}
The tbox TextChanged event working very well but tbox keydown event not working. When I Press Ctrl+C on Editing Control like textbox it's not showing me the concern new form CashShortAC4. I don't know what is wrong in my application. How to solve the problem?.
Reply
Answers (
6
)
Abstract class and Inheritance
Private class variable