title: RadDatePicker and RadTimePicker loses style after postback
body: <p>I found a bug on my site and I can't seem to find a solution.  I am dynamically generating controls, two of which are a RadDatePicker and a RadTimePicker.  When different events occur on the page, I am changing the visibility of the controls between true and false after generating them (essentially based on whether the page is in 'edit' mode or view mode).  However, after the first instance where the controls are visible, the controls lose their styles. Refer to the screenshot below:</p>
  
  <p><img src="https://i.stack.imgur.com/tQngW.jpg" alt="RadDatePicker and RadTimePicker style loss example"></p>
  
  <p>If anyone has any suggestions, or advice, that'd be great. Thanks</p>
  
  <p><strong>Update: Here is the code as requested</strong></p>
  
  <p>This hides and shows controls(just change true/false)</p>
  
  <pre><code>for (int i = 0; i &lt; customProperties.Rows.Count; i++)
  {
      customProperties.FindControl("CustomControl" + (i + 1).ToString()).Visible = false;
      customProperties.FindControl("lblCustomControl" + (i + 1).ToString()).Visible = true;
      Type aType = customProperties.FindControl("CustomControl" + (i + 1).ToString()).GetType();
      if (aType.Name == "RadBinaryImage")
      customProperties.FindControl("CustomControl" + (i + 1).ToString() + "_btn").Visible = false;
  }
  </code></pre>
  
  <p>So basically it searches the htmltable (customProperties) for controls and changes the visibility</p>
  
  <p>This is where the control is generated:</p>
  
  <pre><code>case DynamicFieldTypeEnum.Date:
      RadDatePicker dp = new RadDatePicker();
      dp = currentValues as RadDatePicker;
      if (dp.SelectedDate == null)
          customProperty.Text = "Not Specified";
      else
          customProperty.Text = dp.SelectedDate.Value.ToString(dp.DateInput.DateFormat);
      dp.ID = "CustomControl" + (position + 1).ToString();
  
      newControls[0] = customProperty;
      newControls[1] = dp;
      break;
  case DynamicFieldTypeEnum.Time:
      RadTimePicker tp = new RadTimePicker();
      tp = currentValues as RadTimePicker;
      if (tp.SelectedDate == null)
          customProperty.Text = "Not Specified";
      else
          customProperty.Text = tp.SelectedDate.Value.ToString(tp.DateInput.DateFormat);
      tp.ID = "CustomControl" + (position + 1).ToString();
  
      newControls[0] = customProperty;
      newControls[1] = tp;
      break;
  </code></pre>
  
  <p>This is within a method that is given an object definition and then returns a control array. The first value in the control array is a label for "view" mode and the second control is a control for "edit" mode.</p>
  
  <p>This array is then passed to a different method which places the controls within a table cell which is placed in a table row and then placed in the table "customProperties"</p>