sir,
my name is Babin raj i am a btec student ,i am also working as a freelancer i have a doubt on datagridview combobox .the problem is that when i trys to set a datasource to combobox cell dynamically the color of the combobox dropdown list changes to black color below is the code i have used
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
int n = dataGridView1.CurrentCell.RowIndex;
if (dataGridView1.CurrentCell.ColumnIndex == 0)
{
var cbCell = dataGridView1.Rows[n].Cells["category"] as DataGridViewComboBoxCell;
DataTable dt = c1.ret("select category from category").Tables[0];
cbCell.DataSource = dt;
cbCell.ValueMember = "category";
cbCell.DisplayMember = "category";
cbCell.FlatStyle = FlatStyle.System;
}
}
please help me i have no other source to get the answer for my question i have tryed couple of code from internet but the problem is not fixed
2 Replies
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.
Babin Raj MPosted Sep 14, 2015, 12:43 PM
Baimey RajeshPosted Sep 14, 2015, 7:03 AM