TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Babin Raj M
NA
11
982
datagridview combobox c# winforms
Sep 12 2015 4:24 AM
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
Reply
Answers (
2
)
check wehther name exists in database
Projects in C#