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
Asif Huddani
NA
1
2.3k
Datagrid View colboboxcloumn event problem
Apr 19 2010 2:38 AM
Hello,
I have datagridview on my form having 2 combobox.
One for Country and another for state.
I handle event for both combobox..
When i click on country combobox then it's selected change commited event fire and fill state. working properly...
But when i click on state then also country column event fire and reload the state column.
Please help me.......
private void dgvContactDetail_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
switch (dgvContactDetail.CurrentCell.ColumnIndex)
{
case 1:
{
var cb = (ComboBox)e.Control;
cb.SelectionChangeCommitted -= new EventHandler(countryComboBox_SelectionChangeCommitted);
cb.SelectionChangeCommitted += new EventHandler(countryComboBox_SelectionChangeCommitted);
}
break;
case 2:
{
var cb = (ComboBox)e.Control;
cb.SelectionChangeCommitted -= new EventHandler(stateComboBox_SelectionChangeCommitted);
cb.SelectionChangeCommitted += new EventHandler(stateComboBox_SelectionChangeCommitted);
}
break;
default:
break;
}
}
private void countryComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
// Fill State Combo
}
private void stateComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
// Fill City
}
Thanks,
Asif Huddani
http://asifhuddani.wordpress.com
Reply
Answers (
1
)
Error in Datagrid Page Index changed.
data not transfering from one page to other page in session