RadGrid Filtering Demo issue

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

    Posted 01 Jan 2013 Link to this post

    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.

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 02 Jan 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top