Hi there guys, how can i pass the items from a comboBox to a
dataGridView ?, when i click on a button (btnAdd) the selected item
from a comboBox populate the dataGridView, so i can add some items from
the comboBox to a dataGridView.
I have the comboBox filled with a column (attribute) from a table in
the DataBase. I wat to load all the tuple(from that table) of the
selected item (attribute) in the comboBox as a row of the dataGridView.
Thanks in advance for your help, i will apreciate too much
Loading
azariel moronPosted Sep 2, 2009, 2:03 AM
Kirtan PatelPosted Aug 31, 2009, 11:10 AM
You can do it Following Way First you have to Add Some Columns to DataGridView
then you can Perform it By Following Way
Dont Forget to mark "Do you like answer" please it will give me some Credits :)
private void button1_Click(object sender, EventArgs e)
{
//Add new row to DataGridView
dataGridView1.Rows.Add();
// Add Value From Combobox to DataGridView Cell
dataGridView1.Rows[0].Cells[0].Value = comboBox1.SelectedItem.ToString();
}