I have a column in my RadGrid whose visibility is dependant on a checkbox on the page. When the user checks the checkbox, the column appears. When they uncheck, it disappears. Both the checkbox and the grid are in an ajax panel. Works fine.
My problem is when the user sets a filter for the column in question and then unchecks the checkbox, the filter persists. It's not apparent to the user that data is being filtered because the column with the filter is no longer visible.
So I want to reset the column filter when the user toggles the visiblity of the column. To do this, I have the following code in my checkbox's CheckChanged event handler:
This doesn't seem to have any effect. The grid still filters the data. What am I doing wrong?
My problem is when the user sets a filter for the column in question and then unchecks the checkbox, the filter persists. It's not apparent to the user that data is being filtered because the column with the filter is no longer visible.
So I want to reset the column filter when the user toggles the visiblity of the column. To do this, I have the following code in my checkbox's CheckChanged event handler:
if
(chkShowInActive.Checked)
{
myGrid.Columns.FindByUniqueName(
"IsActive"
).Visible =
true
;
}
else
{
myGrid.Columns.FindByUniqueName(
"IsActive"
).Visible =
false
;
}
myGrid.Columns.FindByUniqueName(
"IsActive"
).CurrentFilterFunction = GridKnownFunction.NoFilter;
myGrid.Rebind();
This doesn't seem to have any effect. The grid still filters the data. What am I doing wrong?