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
anna john
NA
47
8.9k
how to retrieve datagridview combobox columns selected value
Oct 29 2019 3:40 PM
i would like to know what is the selected value of a combobox column in the datagrid view.
for example, i have a combobox called category in my datagrid view. and if the category has values filled up a table in access. and i want to display it in messagebox once its selected/updated.
i am not sure what events should i use .. i tried something like this .. but its not working
private void dgv1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
combo = e.Control as ComboBox;
if (combo != null)
{
combo.SelectedIndexChanged -= new EventHandler(combo_SelectedIndexChanged);
combo.SelectedIndexChanged += combo_SelectedIndexChanged;
}
}
private void combo_SelectedIndexChanged(object sender, EventArgs e)
{
string selected = (sender as ComboBox).SelectedItem.ToString();
MessageBox.Show(selected);
}
Reply
Answers (
1
)
invalid length for base-64 char array or string c#
how to validate rows only if its been edited or added newly