I need a help from you all, i need to place a combo box in datagridview in c# windows application and have to load the combo box with the data from the database. and store the same to different data table.
thanks in advance.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Nov 19, 2014, 8:17 PM EST
If You are using windows application then read following link
http://www.c-sharpcorner.com/UploadFile/9a3ae2/working-with-datagridview-checkboxcombobox-and-button-colum/
If you r using WPF the read following link
http://www.c-sharpcorner.com/uploadfile/dpatra/combobox-in-datagrid-in-wpf/
Ahmed JS80 reputationPosted Nov 20, 2014, 5:57 AM EST
Below link
http://sqlneed.blogspot.com/2014/04/add-combobox-in-datagridview-using-csharp.html
load the combobox with the data from database then use below code.string sql = "Select distinct country from Employees";
SqlConnection cnn = new SqlConnection(con);
SqlDataReader rd;
cnn.Open();
SqlCommand cmd = new SqlCommand(sql, cnn);
rd = cmd.ExecuteReader();
chkbtn.Items.Clear();
while (rd.Read())
{
chkbtn.Items.Add(rd["country"].ToString());
}
cnn.Close();