Seems that in code behind the AllowFilteringByColumn property is always set to false at all phases of life cycle prior to the data binding stages. Code example like below for example is always returning me false.:
protected
void
Page_Load(sender se, EventArgs evt) // Master Page event
{
var grid = ControlHelper.FindControlByCIDRecursive<RadGrid>(Request[
"__EVENTTARGET"
], ContentPlaceHolder1); // Iterate content page to find all RadGrid
if
(grid !=
null
)
{
bool
rebind =
false
;
if
(grid.AllowFilteringByColumn)
foreach
(GridColumn column
in
grid.MasterTableView.Columns)
if
(column.CurrentFilterFunction!=GridKnownFunction.NoFilter) {
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue =
string
.Empty;
rebind =
true
;
}
if
(rebind)
{
grid.MasterTableView.FilterExpression =
string
.Empty;
grid.MasterTableView.Rebind();
}
}
}
Our requirement is to apply a certain DOM class to all grids site-wise. If AllowFilteringByColumn is not propertly populated before databinding is there another way to determine whether filtering is enabled?