2
votes

I have a noob question. I have a WinForm (.net 2.0 in VS 2008) on my form I have a DataGrid. One of the fields in that DataGrid is a combo box that is bound to a separate table. This works, but I am unable to edit or add. I cannot add a value that is not on the list.

I want to create a lookup box (for lack of a better term).

The form is for Parts Order Entry. In the DataGrid Data Source is PartsOrder_table, the Work order Field is an int in the PartsOrder_table, and the combo box is bound to the WorkOrder_table. The WorkOPRder_Table has WorkOrd_ID int and WrkOrd nvarchar(10)

The Combo Box Data Source is WorkOrd_Table Display Member is WorkOrd Value Member is WorkOrder_ID.

This works great with the problem that I cannot add or select anything not in WorkOrder_table.

Any help would be greatly appreciated.

1

1 Answers

0
votes

Seems you cannot in a straight forward manner. This thread shows a way of doing this, by adding the needed values during the Validation of the ComboBox control. See the URL for more details.

http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/31a28e99-6f9f-4cce-b256-9b7cf1ddf69a/