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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ahmed JSPosted Nov 20, 2014, 10:57 AM
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();
Manish Kumar ChoudharyPosted Nov 20, 2014, 1:17 AM
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/