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

how to get the filter work?

15 Answers 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Esperanza Ramos
Top achievements
Rank 1
Esperanza Ramos asked on 03 Jun 2008, 03:28 PM
Hi, Telerik Team:

I have a question:
   
           How to get the filtering feature work, while auto-operations(update, select, delete) are also working?

Currently, I have the auto-operations(update,select..) working, But I don't have the filtering work in my Ajax Rad Grid.

Currently I bind the Grid as:
 
      RadGrid1.DataSourceID = SqlDataSource1.ID;
 
and in my Rad Grid, I set:
         AllowFilteringByColumn="true"
But the filters did not work.

Please help:
   How to get the filtering working, while auto-opetation(update..) are working as well.

Stanley Huang

15 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Jun 2008, 07:17 AM
Hi Stanley,

Can you try setting it in the code behind and see whether Filtering is working.

CS:
protected void RadGrid1_PreRender(object sender, EventArgs e)   
    {   
        RadGrid1.MasterTableView.AllowFilteringByColumn = true;   
        RadGrid1.Rebind();   
    }  



Thanks
Shinu.
0
Esperanza Ramos
Top achievements
Rank 1
answered on 04 Jun 2008, 12:48 PM
Hi, Telerik Team:

I can see the filter items.  I apply a search string "abc" and set filter
to "EqualTo"; it should only search and display the rows, with column
value equals to "abc".  But nothing happens after I apply the search.

Stanley
0
Konstantin Petkov
Telerik team
answered on 04 Jun 2008, 01:12 PM
Hi Stanley Huang,

Can you please elaborate on your environment? Is this the Grid for ASP.NET 2.0 or .Net 3.5? Do you check it on IE or Firefox and have you tried on both? Is your Grid ajaxified through RadAjax or MS AJAX controls?

Please also try the following demo on your end:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx

Note that the online demos run with the latest version of RadControls for ASP.NET AJAX (currently labeled 2008.1.515).

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Esperanza Ramos
Top achievements
Rank 1
answered on 04 Jun 2008, 05:34 PM
Hi, Telerik Team:

I am using VS2005, Asp.net 2.0, and IE as the browser.

I am using Ajaxified Rad Grid and other ajaxified rad controls.

I configured my web.config according to Microsoft's post on
configuring for ASP.NET Ajax.

I visited the link provide by you. 

Please give some detail on how to make the filter works, and I will
have to have auto-operations (update, delete, select) working as
well. Right now, I already have the auto-operations working.

Stanley
0
Esperanza Ramos
Top achievements
Rank 1
answered on 05 Jun 2008, 01:00 PM
Hi, All:

I found the solution to get the filters work:

<

rad:GridTemplateColumn HeaderText="JobNo" SortExpression="JobNo" DataField="JobNo">

That is: set DataField="MyDataColumn".


Good luck and thanks.

Stanley Huang
0
Princy
Top achievements
Rank 2
answered on 06 Jun 2008, 09:18 AM
Hi Stanley,

You can also have a look at the following help article.
Implementing filtering for template/custom columns

Thanks
Princy
0
t
Top achievements
Rank 1
answered on 25 Jun 2008, 07:46 AM

Hi,

I have the same problem. I set "

Grid.MasterTableView.AllowFilteringByColumn = true;"

And in the creation of the several columns i set also the datafield.

One problem ist, that in the filter menu are all filter commands like contians, between, isequal and so on.

When i enter something to search and hit the filter, it is not applied to the grid. The filter menu always is set to NoFilter.

Has anyone a solution for this problem?

0
t
Top achievements
Rank 1
answered on 07 Jul 2008, 08:10 AM
No one with a solution?

More Details:
I use the need_Datasource for databinding and I'm binding an Object[]

I need help!
0
Sebastian
Telerik team
answered on 07 Jul 2008, 08:14 AM
Hello t,

Have you tried setting the AutoPostBackOnFilter property of the corresponding column to true and specifying CurrentFilterFunction value for the corresponding column? Review the information under the Description tab of this online example for more details:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
t
Top achievements
Rank 1
answered on 07 Jul 2008, 08:37 AM
Yes, all those settings are correct.
In my grid I have only columns with strings. IsEmpty, IsNull, NotIsEmpty, NotIsNull work for filtering. Contains and all the other filter functions doesn't
0
Lenny_shp
Top achievements
Rank 2
answered on 06 Aug 2008, 09:47 PM
I have the same issue with 2008 Q2.   Set everything I need to set like everyone else, but when filtering nothing happens.   VS2008 .NET 3.5 XP SP2.   I only tried it when running locally, not sure if if I deploy it it'd make a difference.

[More Info]
Grid is bound to a SQLDataSource OracleClient, DataReader, enableViewState true/false for simple select through a table.
There is a RadScriptManager (required).
Tried with or without a RadAjaxManager (RadGrid1 update to RadGrid1) - no difference.

    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowSorting="True"
        Skin="WebBlue" AllowFilteringByColumn="True"
        GridLines="None" ShowGroupPanel="True" PageSize="50"
        AutoGenerateColumns="False" AllowPaging="True">

            <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" />
           
            <MasterTableView DataKeyNames="ID" CommandItemDisplay="None" AllowFilteringByColumn="true">

                <telerik:GridBoundColumn SortExpression="cscode" HeaderText="CS Code" DataType="System.String" AutoPostBackOnFilter="true"
                    CurrentFilterFunction="EqualTo" AllowFiltering="true" DataField="cscode" UniqueName="cscode" MaxLength="2" ItemStyle-Width="60px">
                    <ItemStyle Width="60px"></ItemStyle>
                </telerik:GridBoundColumn>
            </Columns>

            <RowIndicatorColumn Visible="True">
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn Visible="False" Resizable="False">
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
           
        </MasterTableView>   
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" >
        </ClientSettings>

        <FilterMenu Skin="WebBlue" EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>
        </FilterMenu>
    </telerik:RadGrid>

I have worked with the old RadControl and it was fine with filtering but it was using .NET 2.0.   This is the same data src that I was using from the previous RadGrid.

-- updated for more info.
0
Yavor
Telerik team
answered on 07 Aug 2008, 05:27 AM
Hello Lenny,

Based on the information supplied, it is hard to determine what may be causing the problem. In order to progress in the investigation, please open a formal support ticket, and send us a small working project, demonstrating the issue. We will review it locally, and get back to you with our findings.

Regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Lenny_shp
Top achievements
Rank 2
answered on 07 Aug 2008, 01:23 PM
See my previous post for added info.
I don't have any code behind in any Rad events.
In page_load I have this.
        Me.SqlDataSource1.ConnectionString = strConnectionString

Again this is the exact code I have for the previous RadGrid.

It seems it does not like DataReader (it could only filter on numeric datatype).
When I changed to DataSet for the DataSource OracleClient then the rest of the fields filter worked!
0
Vlad
Telerik team
answered on 11 Aug 2008, 06:44 AM
Hello Lenny_shp,

Please try to set EnableLinqExpressions to false and let me know about the result.

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Lenny_shp
Top achievements
Rank 2
answered on 12 Aug 2008, 06:09 PM
Yes if I have EnableLinqExpressions="false" then DataReader works!

Tags
Grid
Asked by
Esperanza Ramos
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Esperanza Ramos
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Princy
Top achievements
Rank 2
t
Top achievements
Rank 1
Sebastian
Telerik team
Lenny_shp
Top achievements
Rank 2
Yavor
Telerik team
Vlad
Telerik team
Share this question
or