Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box in DataGridView
Message
 
À
14/06/2006 09:44:21
Jeff Corder
Ambit Technologies, LLC
Missouri, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01127500
Message ID:
01129171
Vues:
17
Jeff,

>I placed the data in an MM object (oWorkStations) and set the datagridview ColumnType to DataGridViewComboBoxColumn. Since I can't change the DataSource in the EditColumns form, I used the following code:
>
> DataGridViewComboBoxColumn dgvcc =
> (DataGridViewComboBoxColumn)dgvParents.Columns["colParentFK"];
> dgvcc.DataSource = "WorkStations";
> dgvcc.ValueMember = "WorkStationPK";
> dgvcc.DisplayMember = "ComputerName";

It looks like you are setting the DataSource to a string here? If so, you need to set it to a DataTable reference instead. For example:
dgvcc.DataSource = MyDataSet.Tables["WorkStations"];
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform