This is a migrated thread and some comments may be shown as answers.

Filter multiple columns in a RadGrid

6 Answers 317 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Johnathan
Top achievements
Rank 1
Johnathan asked on 26 Oct 2012, 02:12 PM
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>

6 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 31 Oct 2012, 12:49 PM
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.
0
Hardik
Top achievements
Rank 1
answered on 20 Mar 2015, 11:24 AM
I am facing this same issue can you please tell when this will available?
0
Hardik
Top achievements
Rank 1
answered on 20 Mar 2015, 11:27 AM
I am facing this same issue can you please tell when this will available?
0
Eyup
Telerik team
answered on 25 Mar 2015, 08:07 AM
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.

 
0
Supriya
Top achievements
Rank 1
answered on 03 Aug 2015, 01:16 PM
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

0
Eyup
Telerik team
answered on 06 Aug 2015, 07:22 AM
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
Tags
Filter
Asked by
Johnathan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Hardik
Top achievements
Rank 1
Supriya
Top achievements
Rank 1
Share this question
or