コード例 #1
0
 /// <summary>
 /// Clears the All the combo boxs in the form.
 /// </summary>
 /// <param name="currentControl">The current control.</param>
 private void ClearComboBox(Control currentControl)
 {
     try
     {
         if (currentControl.HasChildren)
         {
             foreach (Control childControl in currentControl.Controls)
             {
                 this.ClearComboBox(childControl);
             }
         }
         else
         {
             if (currentControl.GetType() == typeof(TerraScanComboBox))
             {
                 TerraScanComboBox currentComboBox = (TerraScanComboBox)currentControl;
                 currentComboBox.DataSource = null;
                 currentComboBox.Items.Clear();
                 currentComboBox.Refresh();
             }
         }
     }
     catch (Exception ex)
     {
         //////TODO : Need to find specific exception and handle it.
         ExceptionManager.ManageException(ex, ExceptionManager.ActionType.Display, this.ParentForm);
     }
 }
コード例 #2
0
 /// <summary>
 /// To populate the city directional and suffix Combo Box
 /// </summary>
 /// <param name="controlName">controlName</param>
 /// <param name="comboDisplayValue">comboDisplayValue</param>
 private void PopulateCityDirSufCombox(TerraScanComboBox controlName, string comboDisplayValue)
 {
     if (!string.IsNullOrEmpty(comboDisplayValue))
     {
         controlName.Text = comboDisplayValue;
     }
     else
     {
         controlName.Text          = string.Empty;
         controlName.SelectedIndex = -1;
     }
 }
コード例 #3
0
ファイル: F820002.cs プロジェクト: CSSAdmin/TScan
 private void SetComboSelectedValue(TerraScanComboBox combobox, DataSet comboDataSet, DataSet getDataSet)
 {
     try
     {
         string columnName = string.Empty;
         string value      = string.Empty;
         columnName = this.GetColumnName(combobox.ValueMember, getDataSet);
         if (columnName.Equals(string.Empty))
         {
             columnName = this.GetColumnName(combobox.DisplayMember, getDataSet);
             if (columnName.Equals(string.Empty))
             {
                 this.SetNoneAsDefault(combobox, comboDataSet);
             }
             else
             {
                 value = getDataSet.Tables[0].Rows[0][columnName].ToString();
                 value = this.CheckValue(value, combobox, false, comboDataSet);
                 if (!string.IsNullOrEmpty(value))
                 {
                     combobox.SelectedValue = value;
                 }
                 else
                 {
                     this.SetNoneAsDefault(combobox, comboDataSet);
                 }
             }
         }
         else // if column name is value member
         {
             value = getDataSet.Tables[0].Rows[0][columnName].ToString();
             if (!string.IsNullOrEmpty(this.CheckValue(value, combobox, true, comboDataSet)))
             {
                 combobox.SelectedValue = value;
             }
             else // if the value from get method not present at combo box(combo DataSet)
             {
                 this.SetNoneAsDefault(combobox, comboDataSet);
                 string comboText = getDataSet.Tables[0].Rows[0]["Name"].ToString();
                 combobox.Text = comboText;
             }
         }
     }
     catch
     {
     }
 }
コード例 #4
0
ファイル: F35101.cs プロジェクト: CSSAdmin/TScan
 /// <summary>
 /// Clears the All the comboboxes in the form.
 /// </summary>
 /// <param name="currentControl">The current control.</param>
 private void ClearComboBox(Control currentControl)
 {
     if (currentControl.HasChildren)
     {
         foreach (Control childControl in currentControl.Controls)
         {
             this.ClearComboBox(childControl);
         }
     }
     else
     {
         if (currentControl.GetType() == typeof(TerraScanComboBox))
         {
             TerraScanComboBox currentComboBox = (TerraScanComboBox)currentControl;
             currentComboBox.DataSource = null;
             currentComboBox.Items.Clear();
             currentComboBox.Refresh();
         }
     }
 }