I have a method that I use to reset a form after a submit or if the user chooses to click a reset button. For the most part it works, however if Im using a combobox that is tied to a LoadOnDemand event, the selected item is still displayed. It does appear that the remaining items are reloaded when I click the dropdown arrow.
Here is the code I'm using:
Thanks,
Here is the code I'm using:
public static void resetForm(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c.Controls.Count > 0)
{
resetForm(c);
}
else
{
switch (c.GetType().ToString())
{
case "Telerik.Web.UI.RadTextBox":
((RadTextBox)c).Text = "";
break;
case "Telerik.Web.UI.RadComboBox":
((RadComboBox)c).ClearSelection();
((RadComboBox)c).Text = string.Empty;
break;
case "Telerik.Web.UI.RadTimePicker":
((RadTimePicker)c).Clear();
break;
case "Telerik.Web.UI.RadDatePicker":
((RadDatePicker)c).Clear();
break;
case "System.Web.UI.WebControls.CheckBox":
((CheckBox)c).Checked = false;
break;
}
}
}
}
Thanks,