Set selected index combobox c#
There is a DataBound comboBox in ActivityDialog Form which its DisplayMember is "Title" and ValueMember is "ID". At ActivityDialog_Load() I want to set selectedIndex for comboBox to show the current record's ActivityType. I have tried these but both of them returns -1: comboBox.SelectedIndex = comboBox.Items.IndexOf(1); And Here Mudassar Ahmed Khan has explained with an example, how to set selected value of ComboBox in DataGridView in Windows Forms (WinForms) Application using C# and VB.Net. ComboBox will be added using the DataGridViewComboBoxColumn class and the items will be added to the ComboBox from Database. Once the ComboBox is populated, the item is set as selected in Windows Forms (WinForms) Application