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

RadGrid Filtering Demo issue

1 Answer 74 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Johnathan
Top achievements
Rank 1
Johnathan asked on 01 Jan 2013, 08:32 PM

Hello,

I'm attempting to use the RadGrid filtering with the RadFilter demo to recreate the example myself but unfortunately the filter doesn't apply at all when I attempt to apply it. Here's a copy of the aspx page:

<form id="PageForm" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadFilter1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadFilter1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="SqlDataSource1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
        <div class="filterDiv">
            <telerik:RadFilter runat="server" ID="RadFilter1" FilterContainerID="RadGrid1" ShowApplyButton="false"></telerik:RadFilter>
        </div>
 
        <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"
            AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" OnItemCommand="RadGrid1_ItemCommand">
            <MasterTableView IsFilterItemExpanded="false" CommandItemDisplay="Top">
                <CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick">
                        <Items>
                            <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid" />
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridNumericColumn DataField="PreferenceID" HeaderText="PreferenceID" />
                    <telerik:GridNumericColumn DataField="UserID" HeaderText="UserID" DataType="System.Int32" />
                    <telerik:GridNumericColumn DataField="SiteID" HeaderText="SiteID" DataType="System.Int32" />
                    <telerik:GridBoundColumn DataField="Value" HeaderText="Value" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource runat="server" ID="SqlDataSource1" SelectCommand="Select PreferenceID, UserID, SiteID, Value FROM iWeb..TAB_Preference"
        ConnectionString="<%$ ConnectionStrings:iWeb %>"  />
 
    </form>

Here's the code-behind page:

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
    If e.CommandName = "FilterRadGrid" Then
        RadFilter1.FireApplyCommand()
    End If
End Sub
 
Protected Sub RadToolBar1_ButtonClick(ByVal source As Object, ByVal e As RadToolBarEventArgs)
 
End Sub

Here's a link to the example I'm using:

http://demos.telerik.com/aspnet-ajax/filter/examples/integration/defaultvb.aspx?product=filter

Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 02 Jan 2013, 09:52 AM
Hi Johnathan,

The code shown under the demo is the same used for the demo itself. So it should work without any problem. You can open the live demos project form the installation folder of your controls and to run the same page from there and/or strip the code directly from.
C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q3 2012\Live Demos\Filter\Examples\Integration
We could not say what is the problem without having your datasource and runnable version that can be tested. Since the code in the site is working correctly, it is something up to your datasource, settings or something in copying the code was went wrong.

Greetings,
Vasil
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.
Tags
Filter
Asked by
Johnathan
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or