RadFilterDataFieldEditor with FilterContainerID sets

3 posts, 1 answers
  1. JiriSchmitt
    JiriSchmitt avatar
    10 posts
    Member since:
    Apr 2007

    Posted 14 Jan 2011 Link to this post


    I have created RadFilterDataFieldEditor by following article: http://www.telerik.com/community/forums/aspnet-ajax/filter/error-when-building-custom-radfilterdatafieldeditor.aspx
    It works good if the FilterContainerID property is not set. If I set this property to my RadGrid it does not work correctly.
    Editor is shown ok if I add filter expression, but after I click the Apply button, default editor is shown instead RadFilterDataFieldEditor. After next postback I get error with invalid viewstate data.

    Here is the Code:
    <telerik:RadFilter runat="server" ID="filter" FilterContainerID="articles" ShowApplyButton="true"
            <telerik:RadFilterTextFieldEditor FieldName="Title" />
            <km:RadFilterDropDownEditor DataSourceID="dsStates" DataTextField="Name" DataValueField="ArticleStatusId"
                FieldName="StatusId" />
            <telerik:RadFilterTextFieldEditor FieldName="AuthorFullName" />
            <telerik:RadFilterNumericFieldEditor FieldName="Rating" />
            <telerik:RadFilterNumericFieldEditor FieldName="TimesRated" />
            <telerik:RadFilterDateFieldEditor FieldName="CreatedDate" />
            <telerik:RadFilterDateFieldEditor FieldName="ModifiedDate" />
    <telerik:RadGrid ID="articles" runat="server" OnNeedDataSource="articles_NeedDataSource"
        EnableLinqExpressions="false" ShowFooter="True" AllowFilteringByColumn="True"
        AllowSorting="True" ShowGroupPanel="True" AllowPaging="true" PageSize="10">
        <MasterTableView AutoGenerateColumns="False" EnableHeaderContextMenu="true" IsFilterItemExpanded="false">
                <telerik:GridBoundColumn DataField="Title" HeaderText="Title" />
                <telerik:GridDropDownColumn DataField="StatusId" HeaderText="Status" DataSourceID="dsStates" ListTextField="Name" ListValueField="ArticleStatusId" />
                <telerik:GridBoundColumn DataField="AuthorFullName" HeaderText="Author" />
                <telerik:GridBoundColumn DataField="Rating" HeaderText="Rating" />
                <telerik:GridBoundColumn DataField="TimesRated" HeaderText="TimesRated" />
                <telerik:GridBoundColumn DataField="CreatedDate" HeaderText="Created" />
                <telerik:GridBoundColumn DataField="ModifiedDate" HeaderText="Modified" />
        <GroupingSettings ShowUnGroupButton="true" CaseSensitive="false" />
        <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" />

    protected void filter_FieldEditorCreating(object sender, RadFilterFieldEditorCreatingEventArgs e)
        if (e.EditorType == "RadFilterDropDownEditor")
            e.Editor = new RadFilterDropDownEditor();

    Thank you
  2. Answer
    Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 20 Jan 2011 Link to this post

    Hi Jiri,

    I am afraid that with custom editors RadFilter does not support automatically filtering on container. You should manually apply the expressions to RadGrid. For your convenience I am attaching sample app demonstrating how to achieve this.

    Kind regards,
    Maria Ilieva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. JiriSchmitt
    JiriSchmitt avatar
    10 posts
    Member since:
    Apr 2007

    Posted 20 Jan 2011 Link to this post

    Hi Maria,

    It works.

    Thank you
Back to Top