Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box In DataGridView
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Combo Box In DataGridView
Miscellaneous
Thread ID:
01398010
Message ID:
01398010
Views:
84
I think I posted something like this a while back but I cannot find it.

I want to add a combo box to a DataGridView. So far I have:
grdReceive.DataMember = dsInventory.Tables[0].TableName;
grdReceive.DataSource = dsInventory;

DataGridViewComboBoxColumn comboboxColumn = new DataGridViewComboBoxColumn();
comboboxColumn.DataSource = dsLocations;
comboboxColumn.HeaderText = "Location";
comboboxColumn.Name = "Location";
grdReceive.Columns.Add(comboboxColumn);
grdReceive.Columns["Location"].DisplayIndex = 3;
A couple of problems:

1) I want to populate the combo from a different dataset than the DataGridView. I have a DS called dsLocations, and if I set , comboboxColumn.DataSource = dsLocations, the text "System.Data.DataGridView" appears in the combo. How do I correctly populate this combo from dsLocations?

2) When I click on the combo, nothing happens. I have to click a second time to get the combo to open. It's almost as if I have to select the combo first. This doesn't seem right.

Anyone?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform