Adding a Combo Box to a Data Grid


Author
Message
lmarrette
lmarrette
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 11
Is it possible to add a combo box to a data grid view?  I want the combo box to display a description from a lookup table and store the item's code in the primary table.  I've added Business Binding Sources for each table, but I'm not able to configure the drop down box to display values from the lookup source, but assign the resulting code to the primary table.  If this is not possible with the delivered data grid view, can it be done with the DevExpress data grid?

Thanks for your help.

Lee

lmarrette
lmarrette
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 11
I removed the Business Binding Source for the lookup and added it back and now the field mappings work.  When I display the grid in view only mode, it appears to be working - the data from the lookup table appears.  My problem now is I'm getting an error when the grid is enabled for editing and the combobox drop down style is on and I'm inserting a row.  The error is:

DataGridView Default Error Dialog:  System.Argument.Exception: DataGridViewComboBoxCell value is not valid.  It seems like it's rejecting the empty value before I have a changed to edit.

Thanks for your help.

Lee

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Can you post a sample of your code... the two business objects and the form with the grid would be fine.  If you don't want to post them here, you can ZIP and email them to me.  That way I can step through it and see what the problem might be.
lmarrette
lmarrette
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 11
Hi,

I've attached the form and the two BO files. 

Thanks for looking at this.  If you need more info, please let me know.

Thanks,

Lee

Attachments
UnreadBooks.zip (128 views, 13.00 KB)
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I haven't forgotten you, lmarrette, and I've found the problem... just trying to fix it right now Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search