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;
}
}
}