Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
DataGridView ComboBox to show different data
I've tried everything I can think of. It's time to pick some better brains than mine.
I have a DataGridView which shows items on an invoice. One column is Units of Measure (Each, Box, Dozen...). The Units of Measure for each item may be different. Also, depending on the Unit of Measure, the price, cost and a few other values change. I could just put the Unit of Measure string into the combobox, but I'd be making database hits constantly to update the prices.
I tried binding a business object to each combobox (set when I look up the Inventory item), but it seems that when the Business Object went out of scope, it apparently closed the recordset and things went haywire (very haywire).
I created an object containing the data I was interested in and added the objects to the ComboBox.Items collection. I get an error that the "DataGridViewComboBoxCell value is not valid." Since I picked the value from the list, there must be something else wrong. I overload ToString() in the object and the UOM's are displaying correctly.
Any suggestions will be greatly appreciated.
Jeff Corder
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement