Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box In DataGridView
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Combo Box In DataGridView
Divers
Thread ID:
01398010
Message ID:
01398010
Vues:
85
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform