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

RadGrid + Excel Filtering + AJAX = UpdatePanel Forever

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 12 Dec 2015, 01:10 AM

Hi,

I'm using the new FilterType="HeaderContext" with my RadGrid.  In this case I am going against a large set of items that may take some time to load when the user filters.  So, I have the RadGrid set to register to itself with AJAX which seems to work well in all cases except when a filter is applied from the context menu.  Here's what I observe:

1) User opens context menu and enters in filter criteria.

2) User clicks the 'Filter' button on the content menu.

3) The UpdatePanel displays as it should but, although I can see the filter properly applied to the grid in the background i.e. the items update properly, the UpdatePanel never closes.  It just sits there forever.  Note that other actions in the context menu (sorting for example) work properly and in those cases the UpdatePanel displays and then hides as expected.

 

I've got a minimal page that exhibits the behaviour (code below).  What am I doing wrong?  I really love the new excel filtering capability but I need to AJAX'ify it.  Help!

Regards,

Greg

 

Form:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="radgridajax.aspx.cs" Inherits="Pages.Results.radgridajax" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="ResultsRadAjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="lstBrowseResults">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="lstBrowseResults" LoadingPanelID="LoadingPanel" UpdatePanelCssClass="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

        <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server" Transparency="30" EnableEmbeddedSkins="False"  MinDisplayTime="500">
            <div class="loading">
                <asp:Image ID="imgLoading" runat="server" ImageUrl="loading.gif" AlternateText="loading"></asp:Image>
            </div>
        </telerik:RadAjaxLoadingPanel>  
         
    <div>
        <telerik:RadGrid ID="lstBrowseResults" runat="server" AutoGenerateColumns="False" AllowFilteringByColumn="true" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowSorting="true" GroupingEnabled="true"
            AllowPaging="true" PageSize="10" PagerStyle-Mode="NextPrevNumericAndAdvanced" PagerStyle-AlwaysVisible="true" FilterType="HeaderContext"
            OnNeedDataSource="lstBrowseResults_NeedDataSource" >
            <MasterTableView GridLines="None" DataKeyNames="ID">
                <Columns>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="lstBrowseResults_colName" DataType="System.String" HeaderStyle-Width="150" FilterCheckListEnableLoadOnDemand="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

 

Code behind:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace Pages.Results
{
    public partial class radgridajax : System.Web.UI.Page
    {

        public class Item
        {
            public int ID { get; set; }
            public String Name { get; set; }
            public Item(int id, String name)
            {
                ID = id;
                Name = name;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void lstBrowseResults_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            List<Item> items = new List<Item>();
            for (int i = 0; i < 100; i++)
                items.Add(new Item(i, i.ToString()));

            lstBrowseResults.DataSource = items;
        }
    }
}

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 16 Dec 2015, 03:25 PM
Hi Greg,

I already answered your question in the support ticket that you have opened but I will post it here as well if other customer have the same issue.

I examine the provided code and it looks like a bug. The reason for this behaviour is that two requests are fired at the same time and the first one is aborted which prevent hiding the Loading panel. I already logged it in our system and meanwhile you can remove MinDisplayTime property to workaround it.

Regards,
Kostadin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or