Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We normally insert textbox values based on combobox value.But how can this be done in a datagridview???

What I have tried:

I tried different C# coding.
Posted
Updated 31-Oct-17 4:30am
Comments
Karthik_Mahalingam 31-Oct-17 5:48am    
Use Improve question to add more info to the question.

1 solution

int row = 0;
dataGridView1.Rows.Add();
row = dataGridView1.Rows.Count - 2;
\\for combobox
dataGridView1["Item", row].Value = comboBox1.SelectedItem.ToString();
\\for label
dataGridView1["Price", row].Value = label7.Text;
\\for textbox
dataGridView1["Quantity", row].Value = textBox3.Text;
 
Share this answer
 

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