Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
DataGridViewComboBox Adding Objects
I am using the mmDataGridView to show items ordered. I have a Unit of Measure column (each, dozen, box...) where the user selects the UOM and based on that I change prices and other data. The options may vary for each row, so I can't just bind the column. In attempting to be bold, I add business entities to the DataGridViewComboBoxCell instead of just a string containing the unit.
Ent.SetDataRow(dr);
UOMCell.Items.Add(Ent);
To display and retrieve the data, I also set:
((DataGridViewComboBoxColumn)(this.dgvItems.Columns["colUOM"])).DisplayMember = "UOMName";
((DataGridViewComboBoxColumn)(this.dgvItems.Columns["colUOM"])).ValueMember = "Self";
Where Self returns the busines object entity.
On the first row, all goes well. After that, the grid doesn't redraw completely. Cells only update when they are selected and on the last row even the cells only display when moving through the cells (the row starts off with only one cell displayed). After entering several rows, the vertical lines between the cells no longer align.
I have been unable to find anything referencing a problem like this. Any help would 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