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
Samio
NA
201
176.8k
Datagridview with Comboboxcolumn using Entity Framework 4, C# in Windows Forms
May 14 2012 4:44 AM
I'm trying to populate a datagridview with Combobox column using the Northwind EF classes Orders and Customers. I used the following code to fill the unbound DataGridViewcomboColumn with customers names, to make possible the quick change of customer name while orders are displayed in the datagridview.
NorthwindEntities nw;
private void Form1_Load(object sender, EventArgs e)
{
nw = new NorthwindEntities();
ordersBindingSource.DataSource = nw.Orders;
DataGridViewComboBoxColumn CustomerName = new DataGridViewComboBoxColumn()
{
HeaderText="Name",
DataPropertyName = "CustomerID",
DataSource = nw.Customers.Execute(MergeOption.AppendOnly),
ValueMember = "CustomerID",
DisplayMember = "CompanyName"
};
}
With the above code the combocolumn stay empty when orders are displayed in the datagrid. Have I made any mistake, please help …
Reply
Answers (
6
)
Firebird Database Multiple User instances creation?
Insert Data In ListView