kahlua001 Posted August 23, 2006 Posted August 23, 2006 Hi, I have a datagridview with a combobox column. the gridview is bound to a datatable as a datasource. The combobox display and value members are set to another datatable so it fills on render and is auto selected based on the row's value. The problem I am having is when I add a new row and select a value from the combobox and then click away from the cell, the value of jumps to a different value, I can't really see a pattern for which value it set to, its just different. Any clues what I'm doing wrong? The list is like 40 items. I have another combobox in the same grid with about 5 values and that works fine. THanks exItem.DataSource = globals.dtInventoryItems 'This is teh comboxbox exItem.DataPropertyName = "item_id" exItem.DisplayMember = "description" exItem.ValueMember = "item_id" dgrdvRules.AutoGenerateColumns = False dgrdvRules.DataSource = globals.dtEventInventoryRules 'This is the datagridview Its pretty simple, not sure what I'm doing wrong. Quote
Pharean Posted January 11, 2011 Posted January 11, 2011 I think you have a similar problem we faced here. Basicly you give a property of your class as valuemember, instead of the object itself, so the datagrid tries to save that "Item_ID"-property as an object. The trick is to change the value member to a property that actually gives the object itself, as described in the thread linked above. Again all credit goes to whoever wrote this. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.