Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Datagrid View colboboxcloumn event problem
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Asif Huddani
14y
2k
1
Reply
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
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to get free bpel tool for visual studio 2008
when to channel factory in WCF