October 13th, 2008, 09:50 PM
[RESOLVED] Setting Selected Index on DataGridView Combobox
I can't seem to set the selected index or selected value of a DataGridView combobox when loading data from a database. My DGV has two combobox columns which are bound to datatables. The DGV itself is not bound initially. After adding a row, I select a value from each combobox which then populates the rest of the cells in the row. I'm using the EditingControlShowing event to add an eventhandler to catch the SelectedIndexChange of the combo boxes. This all works as needed. My issue comes when populating the DGV with saved data, I need to add the rows and set the selected index and/or selected value of each combo box. I've searched through various forums and articles for the last week with no luck.
I'm using VS2008 sp1, .NET 3.5 sp1 and SQL 2005 sp2 Express.
I'm fairly new to .NET and winforms development, coming mostly from a web background so any help is greatly appreciated.
Please let me know if I need to give more details or post any code.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!