Tuesday 23 December 2014

set value in combobox in C#

 if (cmbHRU.Items.Count > 0)
                    {
                        // Search the Item that matches the string
                        int index = cmbHRU.FindString(_dtExistingStdata.Rows[0]["hru_id"].ToString());
                        // Select the Item in the Combo
                        cmbHRU.SelectedIndex = index;
                    }

No comments:

Post a Comment