Filter multiple columns in a RadGrid

7 posts, 0 answers
  1. Johnathan
    Johnathan avatar
    31 posts
    Member since:
    Sep 2012

    Posted 26 Oct 2012 Link to this post

    Hello,

    I've got a problem with filtering multiple columns in a RadGrid. The RadGrid code is shown below. Basically, the RadGrid below sets the CurrentFilterFunction property to default value, which is what we want. The issue is if a user changes the default filter function on multiple columns and attempts to filter based on those columns, it doesn't work because the first column filter that was changed will reset to the default CurrentFilterFunction value when the page posts back. Is there a way to save both filter function changes and allow the user to filter on multiple columns that way?
    <telerik:RadGrid ID="TasksGrid" runat="server" >
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="TaskID" HeaderStyle-Width="95" ItemStyle-Width="95"    HeaderText="Task ID" SortExpression="TaskID" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                <GridRadComboFilter:GridRadComboFilter DataField="FlagID" HeaderText="Flag" SortExpression="FlagID" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50" />
                <telerik:GridBoundColumn DataField="AssignedTo" HeaderText="Assigned To" SortExpression="AssignedTo" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Site" HeaderText="Site" SortExpression="Site" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Product" HeaderText="Product" SortExpression="Product" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn >
                <telerik:GridBoundColumn DataField="SupportType" HeaderText="Support Type" SortExpression="SupportType" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true"></telerik:GridBoundColumn >
                <telerik:GridBoundColumn DataField="Issue" HeaderText="Reported Issue" SortExpression="Issue" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn >
                <telerik:GridBoundColumn DataField="LastUpdatedText" HeaderText="Last Updated Text" SortExpression="LastUpdatedText" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn >
                <telerik:GridDateTimeColumn FilterControlWidth="110px" DataField="LastUpdatedDate" SortExpression="LastUpdatedDate" HeaderText="Last Updated Date" PickerType="DatePicker" DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridDateTimeColumn>
                <telerik:GridDateTimeColumn FilterControlWidth="110px" DataField="RequestedCompletionDate" SortExpression="RequestedCompletionDate" HeaderText="Req Completion Date" PickerType="DatePicker" DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn >                   
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 31 Oct 2012 Link to this post

    Hi Johnathan,

    I successfully replicated the issue on my side and I confirm that the CurrentFilterFunction does not persist on PostBacks when defined on the code behind.

    I will forward this issue to our developers who will analyze the mentioned behavior and provide a proper approach. I will reply to you when they are ready with the result.

    Thank you for your valuable feedback.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hardik
    Hardik avatar
    6 posts
    Member since:
    Dec 2013

    Posted 20 Mar 2015 Link to this post

    I am facing this same issue can you please tell when this will available?
  5. Hardik
    Hardik avatar
    6 posts
    Member since:
    Dec 2013

    Posted 20 Mar 2015 Link to this post

    I am facing this same issue can you please tell when this will available?
  6. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 25 Mar 2015 Link to this post

    Hi Hardik,

    I've created a basic RadGrid web site sample with enabled filtering functionality. Can you please run the attached application and instruct us the exact steps we need to follow in order to reproduce the described issue?

    Regards,
    Eyup
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  7. Supriya
    Supriya avatar
    3 posts
    Member since:
    Jul 2014

    Posted 03 Aug 2015 Link to this post

    Hi,


    I have used ASP.NET AJAX radgrid in my project. Grid columns are filled dynamically in code behind using AutoGenerateColumns="true" property. Dynamic columns are not fixed. Also my page contain ajax functionality because of that it is not showing filter dropdown menu(Less than,Greater than).
    Another problem is that when I enter value in column filter textbox and when I clicked on filter button it postbacks the page and it does not bind grid based on filtering conditioning. Also I try to use Itemcommand property for filtering it is giving command name blank value. Please help me if you have any solution

  8. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 06 Aug 2015 Link to this post

    Hi Supriya,

    Could you verify that you are not using DataBind() to bind the grid? Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Exporting, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
    Declarative DataSource
    Programmatic Data Binding


    Also, you can temporarily disable any AJAX on the page if present (RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.) and enable your script debugger (FireBug or F12) to see whether there is script error interfering.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017