Filter Issue in RadGrid

5 posts, 0 answers
  1. Neetu
    Neetu avatar
    5 posts
    Member since:
    Feb 2012

    Posted 08 Jan 2013 Link to this post

    Happy new year to all.


    I am using RadGrid control on a web page which used to work fine. I have recently updated to the latest version and now gets scripting error when changing filter text. Records are filtered for the first time but if a new text is entered in the filter column and enter key is pressed to re-filter records then following error message is displayed
    Unhandled exception at line 33, column 1 in script block
     
    0x800a138f - Microsoft JScript runtime error: Unable to get value of the property '_filterNoDelay': object is null or undefined
     
    The error is in the onchange function
     
    function onchange(event)
    {
    $find("ctl00_ContentPlaceHolder1_jobauthorisationawaiting_userControl_RadGrid1_ctl00")._filterNoDelay("ctl00_ContentPlaceHolder1_jobauthorisationawaiting_userControl_RadGrid1_ctl00_ctl02_ctl01_FilterTextBox_DepotDescription","DepotDescription")
    }

    Grid is defined as below
     
    telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Office2010Blue"
    AutoGenerateColumns="False" AllowSorting="True" PageSize="18" Height="430" Width="100%" EnableLinqExpressions="false"
    AllowPaging="False" AllowMultiRowSelection="False" runat="server" Gridlines="None" ShowFooter="true" AllowFilteringByColumn="true" 
    OnItemCreated="RadGrid1_ItemCreated">
        <GroupingSettings CaseSensitive="false"></GroupingSettings>
     
     <MasterTableView Name="JobsAwaitingAuthorisation" AllowMultiColumnSorting="false" Width="100%" Summary="Jobs awaiting authorisation" DataKeyNames="ItemID,PurOrderRef,OrderNo" ClientDataKeyNames="ItemID">
         <Columns>
            <telerik:GridBoundColumn HeaderStyle-Width="90" UniqueName="BookedDate" SortExpression="BookedDate" DataField="BookedDate"
                HeaderText="Job Date" DataFormatString="{0:dd/MM/yyyy}" FilterControlWidth="52" FooterText="Job Count:" FooterStyle-HorizontalAlign="Right" AutoPostBackOnFilter="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" HeaderStyle-Width="88" UniqueName="RegNo" SortExpression="RegNo" HeaderText="Reg Num" DataField="RegNo" DataType="System.String"
                 FooterText=" " Aggregate="Count" FilterControlWidth="50" FooterStyle-HorizontalAlign="Left" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="86" FilterControlWidth="60" UniqueName="DepotDescription" SortExpression="DepotDescription" HeaderText="Depot" DataField="DepotDescription"
                 AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" HeaderStyle-Width="208" UniqueName="Description" SortExpression="Description" HeaderText="Job Details"
                DataField="Description" FooterText="Total:"   FilterControlWidth="175" FooterStyle-HorizontalAlign="Right">
            </telerik:GridBoundColumn>
            <telerik:GridNumericColumn  AutoPostBackOnFilter="true" HeaderStyle-Width="65" UniqueName="Parts" SortExpression="Parts"  DataField="Parts"
                HeaderText="Parts" DataFormatString="{0:C}"  FilterControlWidth="30"
                ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" Aggregate="Sum" FooterStyle-HorizontalAlign="Right">
            </telerik:GridNumericColumn>
            <telerik:GridNumericColumn  AutoPostBackOnFilter="true" HeaderStyle-Width="65" UniqueName="Labour" SortExpression="Labour"  DataField="Labour"
                HeaderText="Labour" DataFormatString="{0:C}"  FilterControlWidth="30"
                ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" Aggregate="Sum" FooterStyle-HorizontalAlign="Right">
            </telerik:GridNumericColumn>
            <telerik:GridNumericColumn  AutoPostBackOnFilter="true" HeaderStyle-Width="80" UniqueName="RCSubTotal" SortExpression="RCSubTotal"  DataField="RCSubTotal"
                HeaderText="Total" DataFormatString="{0:C}"  FilterControlWidth="46"
                ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" Aggregate="Sum" FooterStyle-HorizontalAlign="Right">
            </telerik:GridNumericColumn>
            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" HeaderStyle-Width="92" UniqueName="OrderNo" SortExpression="OrderNo" FilterControlWidth="55" HeaderText="Order No" DataField="OrderNo" FooterStyle-Width="110">
                <ItemTemplate>
                    <%# Eval("OrderNo")%>
                </ItemTemplate>
                <FooterTemplate>
                    <telerik:RadButton ID="btnApproveSelected" runat="server" Type="Button"
                        Text="Approve" Tooltip="Approve Selected Jobs" Width="50" OnClientClicked="ApproveSelectedJobs" autopostback="false">
                    </telerik:RadButton>
                    <img style="float:right;cursor:pointer" src="style/images/print.png" border="0" title="Print Jobs Authorised Today" onclick="PrintRadGrid();return false;" />
                </FooterTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridClientSelectColumn HeaderStyle-Width="25"  HeaderStyle-CssClass="rgRowSelected" HeaderTooltip="Select a row by clicking the tick box" HeaderText="Sel" UniqueName="ClientSelectColumn" />
            <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderStyle-Width="20" AllowFiltering="false">
                <ItemTemplate>
                    <asp:Image ID="ApproveImage" runat="server" Width="16" Height="16" ImageUrl="Update.gif" ToolTip="Approve Job" style="cursor:pointer;vertical-align:top" />
                    <asp:Image ID="QueryImage" runat="server" Width="16" Height="16" ImageUrl="Cancel.gif" ToolTip="Query Job" style="cursor:pointer" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="ItemID" SortExpression="ItemID" HeaderText="ItemID" DataField="ItemID" Display="false" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="PurOrderRef" SortExpression="PurOrderRef" HeaderText="PurOrderRef" DataField="PurOrderRef" Display="false" ReadOnly="True">
            </telerik:GridBoundColumn>
        </Columns>
     </MasterTableView>
     <ClientSettings EnableRowHoverStyle="true">
        <ClientEvents OnGridCreated="GridCreated" OnFilterMenuShowing="filterMenuShowing" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
        </Scrolling>
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <FilterMenu OnClientShown="MenuShowing" />
    <PagerStyle Mode="NextPrevAndNumeric" />
    </telerik:RadGrid>
  2. Eyup
    Admin
    Eyup avatar
    3756 posts

    Posted 10 Jan 2013 Link to this post

    Hi Neetu,

    I have already replied to the your query in your support ticket 646261. Please note that avoiding multiple threads with similar issues will enable us to respond more quickly and efficiently to your posts.

    Greetings,
    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.
  3. Roger
    Roger avatar
    5 posts
    Member since:
    Aug 2007

    Posted 06 Jun 2013 Link to this post

    I am having the same issue with the grid using filtering.  Can you share the solution?  The datasource is a custom collection and is being bound server side Here is my code...

    protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    var s3Search = new S3SearchService();
                    var results = s3Search.GetFiles("", FileExtention, "0");
                    Session["SEARCH_RESULTS"] = results;
                    rgFiles.DataSource = results;
                    rgFiles.DataBind();
                }
            }
     
            protected void rgFiles_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
            {
                rgFiles.DataSource = Session["SEARCH_RESULTS"];
            }


    <telerik:RadAjaxManager ID=
    "RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgFiles">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgFiles" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadGrid AutoGenerateColumns="false" ID="rgFiles" OnNeedDataSource="rgFiles_NeedDataSource"
        AllowFilteringByColumn="True" AllowSorting="True" PageSize="15"
        ShowFooter="True" AllowPaging="True" runat="server" GridLines="None" EnableLinqExpressions="false">
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
        <GroupingSettings CaseSensitive="false"></GroupingSettings>
        <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"
            ShowFooter="True" TableLayout="Auto">
            <Columns>
                <telerik:GridBoundColumn FilterControlWidth="105px" DataField="FileName" HeaderText="File Name"
                    SortExpression="FileName" UniqueName="FileName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AutoPostBackOnFilter="False" AllowFiltering="False" DataField="UploadDate" DataType="System.DateTime" HeaderText="Upload Date" UniqueName="UploadDate" SortExpression="UploadDate">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="True"></Selecting>
            <ClientEvents OnRowSelected="RowSelected"></ClientEvents>
        </ClientSettings>
    </telerik:RadGrid>


    Thank You :-)
  4. Eyup
    Admin
    Eyup avatar
    3756 posts

    Posted 11 Jun 2013 Link to this post

    Hi Roger,

    I am attaching the sample web site as requested. Please note that using DataBind() is not recommended. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, 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
    Advanced Data Binding

    Hope this helps.

    Regards,
    Eyup
    Telerik
    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 the blog feed now.
  5. Zeev
    Zeev avatar
    6 posts
    Member since:
    Dec 2011

    Posted 23 May 2018 in reply to Eyup Link to this post

    I have the same issue. What was the resolution ?
Back to Top