private void Clearbtn_Click(object sender, EventArgs e)
{
foreach (Control ctrl in basicgroup.Controls)
{
try
{
if (ctrl.GetType() == typeof(TextBox))
ctrl.Text = "";
if (ctrl.GetType() == typeof(CheckBox))
{
CheckBox ctrlcb = (CheckBox)ctrl;
ctrlcb.Checked = false;
}
if (ctrl.GetType() == typeof(ComboBox))
{
ComboBox ctrlcbo = (ComboBox)ctrl;
ctrlcbo.SelectedIndex = 0;
}
}
catch //(System.Exception ex)
{
}
}
foreach (Control ctrl in advgroup.Controls)
{
try
{
if (ctrl.GetType() == typeof(TextBox))
ctrl.Text = "";
if (ctrl.GetType() == typeof(CheckBox))
{
CheckBox ctrlcb = (CheckBox)ctrl;
ctrlcb.Checked = false;
}
}
catch //(System.Exception ex)
{
}
}
type_cbo.SelectedIndex = 0;
group_cbo.SelectedIndex = 0;
status_cbo.SelectedIndex = 0;
SearchResultGrid.DataSource = "";
}