Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my application combobox is one column field of datagridview.when i selecting items in combobox corresponding data is display from database in to the TextBox Column Field of datagridview ...how to do?
Posted
Updated 22-Feb-13 22:50pm
v2

1 solution

C#
private void showSelectedButton_Click(object sender, System.EventArgs e) {
    int selectedIndex = comboBox1.SelectedIndex;
    Object selectedItem = comboBox1.SelectedItem;

    MessageBox.Show("Selected Item Text: " + selectedItem.ToString() + "\n" +
                    "Index: " + selectedIndex.ToString());
}
 
Share this answer
 
Comments
KARISHMAKANNAN 24-Feb-13 12:38pm    
But this solutions combobox is outside na? But in my aplication combobox is inside in datagridview ie one column of datagrid is combobox.when i selecting combo box corresponding data will be display in datagridTexbox ....how to do this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900