/// <summary> /// Handles the ApplyFilterClick event of the fDevice control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void ApplyFilterClick(object sender, EventArgs e) { GridFilter.DeleteUserPreferences(); foreach (Control control in GridFilter.Controls) { var key = control.ID; string value = null; string name = null; if (control is DateRangePicker) { var dateRangePicker = control as DateRangePicker; if (dateRangePicker.UpperValue.HasValue && dateRangePicker.LowerValue.HasValue) { value = dateRangePicker.DelimitedValues; name = key.Remove(0, 3).SplitCase(); } } else if (control is RockDropDownList) { var dropDownList = control as RockDropDownList; value = dropDownList.SelectedValue; name = key.Remove(0, 3).SplitCase(); } else if (control is RockTextBox) { var textBox = control as RockTextBox; value = textBox.Text; name = key.Remove(0, 2).SplitCase(); } GridFilter.SaveUserPreference(key, name, value); } gReport_GridRebind(sender, e); }