Esempio n. 1
0
    /// <summary>
    /// Selects item with specified value in a drop down list if drop down list contains that item.
    /// </summary>
    /// <param name="dropDownList">Drop down list</param>
    /// <param name="value">Value of the item to be selected</param>
    private void SelectItemIfFound(CMSDropDownList dropDownList, string value)
    {
        ListItem mainItem = dropDownList.Items.FindByValue(value);

        if (mainItem != null)
        {
            dropDownList.ClearSelection();
            mainItem.Selected = true;
        }
    }
 private void ClearAddressList(CMSDropDownList list)
 {
     list.ClearSelection();
     list.SelectedIndex = -1;
 }
 /// <summary>
 /// Selects item with specified value in a drop down list if drop down list contains that item.
 /// </summary>
 /// <param name="dropDownList">Drop down list</param>
 /// <param name="value">Value of the item to be selected</param>
 private void SelectItemIfFound(CMSDropDownList dropDownList, string value)
 {
     ListItem mainItem = dropDownList.Items.FindByValue(value);
     if (mainItem != null)
     {
         dropDownList.ClearSelection();
         mainItem.Selected = true;
     }
 }