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

New to filtering

2 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michelle Scott
Top achievements
Rank 1
Michelle Scott asked on 23 Aug 2010, 04:54 PM
I have a  RadGrid and code behind and I'm trying to filter on a column.  I am also following the basic example under live examples (except am using NeedDataSource instead of using a SqlDataSource in my code).  When I hit enter in a filter I get the AJAX loading circle but nothing is ever filtered.  Can anyone tell me what I'm doing wrong?  I believe I am following the example correctly:

Code Behind:
 protected override void OnInit(EventArgs e)
 {
this.RadGridItems.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGridItems_NeedDataSource);
        base.OnInit(e);
}

void RadGridItems_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
this.RadGridItems.DataSource = Item.ListItems(); /* My object which is being bound and displayed correctly in the radgrid */
}

ASP.NET Code (I've slimmed the example to just one GridBoundColumn--all data is displayed correctly):
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGridItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridItems" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

<telerik:RadGrid ID="RadGridItems" runat="server" GridLines="None" AllowPaging="True" CssClass="RadGrid" PageSize="20"
        AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true" AllowMultiRowSelection="false" AllowFilteringByColumn="True">
        <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Id" AllowFilteringByColumn="True">
            <Columns>
                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  />
                <telerik:GridBoundColumn UniqueName="CatalogNumber" HeaderText="Catalog Number" DataField="CatalogNumber" HeaderStyle-Width="20%" 
                     CurrentFilterFunction="EqualTo" FilterDelay="4000" ShowFilterIcon="false" SortExpression="CatalogNumber" />
            </Columns>
        </MasterTableView>
</telerik:RadGrid>

This code properly shows the radgrid control and populates it with data.  When I type text into the filter box, the AJAX loading panel shows but nothing is ever filtered.

I'd really appreciate some help as to what I'm doing wrong.

Thanks,

Ken

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 26 Aug 2010, 10:56 AM
Hello Kenneth,

I tried to replicate the issue in a project closely following your code but to no avail. You can find it attached to this post, could you please view it and let me know if I am missing anything out?

Sincerely yours,
Tsvetina
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Michelle Scott
Top achievements
Rank 1
answered on 26 Aug 2010, 01:36 PM
Thanks for the help.  After much hair-pulling (and I apologize this was not in the example--didn't think it would have an impact), I found what was preventing the filtering from working.

<ClientSettings><ClientEvents OnRowDblClick="jsfunction" /></ClientSettings>

That following portion would make the filtering not work.  I since removed it since filtering was more important to me than being able to double click on a column for editing.

Thanks,

Ken
Tags
Grid
Asked by
Michelle Scott
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Michelle Scott
Top achievements
Rank 1
Share this question
or