Setting a selected value in a ComboBox column when using ObjectDataSource


  • I used the sample code in this post to create an ObjectDataSource grid in my Windows Form:

    However, the sample code provided only demonstrates how to use the ObjectDataSource to display existing information from the IList-based property.

    What I want to actually achieve is to be able to bind to that property to display the default list of values in the ComboBox, but set the actually selected value based on data from another source such as an XML File.

    Is there an easy way to accomplish this?  I was originally using a DataGridView to display the individual columns, but the sample code provided in the previous forum post indicated dragging and dropping the actual ObjectDataSource onto the WinForms control to use for display.

    Ideally, I believe I need to continue using the DataGridView control since I want to allow the ability to add, update or delete existing rows rather than simply display read-only data that has been bound to the class.

    Please advise.

    3 มีนาคม 2555 1:30