Hi,
I have a radgrid built completely from code-behind as a server-control. I am trying to add column filters to some of its columns. When I set the properties required for filtering (AllowFilteringByColumn on the grid) I see the filters on the columns. I then create the columns in code-behind - set the filter properties on them - and add it to the grid's column collection. When I type text in the filter column and press Enter the page/grid doesn't postback. Nothing happens. What am I missing in the below code?
The constructor that initializes the control
public
RadGridOpportunity()
{
this
.ID =
"grdOpportunity"
;
this
.MasterTableView.AutoGenerateColumns =
false
;
this
.MasterTableView.DataKeyNames =
new
string
[] {
"ID"
};
this
.MasterTableView.Columns.Add(ColStatus());
this
.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind;
this
.MasterTableView.NoRecordsTemplate =
new
TemplateNoRecords();
this
.ItemCommand += RadGridOpportunity_ItemCommand;
this
.ItemCreated += RadGridOpportunity_ItemCreated;
this
.MasterTableView.NestedViewTemplate =
new
TemplateNestedView();
this
.NeedDataSource += RadGridOpportunity_NeedDataSource;
//filtering
this
.AllowFilteringByColumn =
true
;
this
.MasterTableView.AllowFilteringByColumn =
true
;
}
The column that is built and added to the columns collection-
protected
GridColumn ColStatus()
{
GridBoundColumn col =
new
GridBoundColumn();
col.HeaderText =
"Status"
;
col.DataField =
"Status"
;
col.CurrentFilterFunction = GridKnownFunction.Contains;
col.ShowFilterIcon =
false
;
col.AutoPostBackOnFilter =
true
;
col.DataType = Type.GetType(
"System.String"
);
return
col;
}