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

_currentFilterTimeoutID is null when ajax enabled for RadGrid

3 Answers 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 14 Sep 2011, 03:28 PM
Hi,

I activated ajax for my rad grids and since then I can see in the console output of Chrome the following error when I do some filtering:

Uncaught TypeError: Cannot read property '_currentFilterTimeoutID' of null

That are the settings that caused this:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1
" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="200" />

Everything else seems to work fine. There are no more postbacks when filtering and the loading panel displays correctly. But the error is annoying. This is the complete callstack from chrome:

Uncaught TypeError: Cannot read property '_currentFilterTimeoutID' of null
(anonymous function)                                                schedule.aspx:1
onchange                                                            schedule.aspx:2
Sys.WebForms.PageRequestManager._updatePanel                        Telerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._scriptIncludesLoadComplete         Telerik.Web.UI.WebResource.axd:15
(anonymous function)                                                Telerik.Web.UI.WebResource.axd:6
(anonymous function)                                                Telerik.Web.UI.WebResource.axd:6
Sys._ScriptLoader._loadScriptsInternal                              Telerik.Web.UI.WebResource.axd:15
Sys._ScriptLoader._nextSession                                      Telerik.Web.UI.WebResource.axd:15
Sys._ScriptLoader.loadScripts                                       Telerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._onFormSubmitCompleted              Telerik.Web.UI.WebResource.axd:15
(anonymous function)                                                Telerik.Web.UI.WebResource.axd:6
(anonymous function)                                                Telerik.Web.UI.WebResource.axd:6
Sys.Net.WebRequest.completed                                        Telerik.Web.UI.WebResource.axd:6
_onReadyStateChange                                                 Telerik.Web.UI.WebResource.axd:6



Thanks for your help!

Edit: I just removed the RadGrid from AjaxUpdatedControls and since then there is no more error. But instead - as expected - the postbacks are back.
As further information, all visible columns have "AutoPostBackOnFilter" enabled and no FilterDelay set. Setting the FilterDelay to null or e.g. 4000 doesn't remove the error.


3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 17 Sep 2011, 07:59 AM
Hello Jp,

I tried replicating the error on this demo but no avail. Here the second grid column has AutoPostBackOnFilter without FilterDelay and the grid is also ajaxified. Can you confirm you can see the same behavior there and specify what differs in your case?

Best wishes,
Iana Tsolova
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
JP
Top achievements
Rank 1
answered on 19 Sep 2011, 09:01 AM
Hi,

the demo works without any problems. Perhaps there is a little bug in my code which I haven't found yet...
My grid has one checkbox column, three hidden columns (internal id, internal text, image url), one image column for which the image is set in the Databound event (the image name is written to a hidden column because the image can be different for each row) and some columns which are created by data-binding.

This is the method where the RadGrid is created (EnsureChildControls is called in OnInit):
protected override void CreateChildControls()
      {
         m_radGrid = new RadGrid();
         m_radGrid.ID = m_idPrefix + "RadGridResources";
         m_radGrid.NeedDataSource += _RadGridNeedDataSource;
         m_radGrid.ColumnCreated += _RadGridColumnCreated;
         m_radGrid.ItemDataBound += _RadGridItemDataBound;
         m_radGrid.AllowMultiRowSelection = true;
         m_radGrid.MasterTableView.Columns.Add(new GridClientSelectColumn { UniqueName = "ClientSelectColumn" });
         m_radGrid.MasterTableView.Columns.Add(_CreateGridImageColumn(ImageColumnUniqueName));
         m_radGrid.MasterTableView.NoMasterRecordsText = Resources.ResourceGridViewNoResourcesFound;
         m_radGrid.MasterTableView.ClientDataKeyNames = new[] { "ID" };
         m_radGrid.SortingSettings.SortToolTip = Resources.ResourceGridViewTooltipClickHereToSort;
         m_radGrid.SortingSettings.SortedAscToolTip = Resources.ResourceGridViewTooltipSortAscending;
         m_radGrid.SortingSettings.SortedDescToolTip = Resources.ResourceGridViewTooltipSortDescending;
         m_radGrid.ClientSettings.EnableRowHoverStyle = true;
         m_radGrid.ClientSettings.Selecting.AllowRowSelect = true;
         m_radGrid.AllowFilteringByColumn = true;
         m_radGrid.AllowSorting = true;
         m_radGrid.ClientSettings.ClientEvents.OnRowSelected = "ResourceGridRowSelected";
         m_radGrid.ClientSettings.ClientEvents.OnRowDeselected = "ResourceGridRowDeselected";
         m_radGrid.ClientSettings.ClientEvents.OnRowCreated = "ResourceGridRowCreated";
         m_radGrid.ClientSettings.ClientEvents.OnGridCreated = "ResourceGridCreated";
         m_radGrid.ClientSettings.Scrolling.AllowScroll = true;
          
         Controls.Add(m_radGrid);
 
         base.CreateChildControls();
      }


This is where the filter is set / the columns are set to invisible.
private static void _RadGridColumnCreated(object sender, GridColumnCreatedEventArgs e)
      {
         switch (e.Column.UniqueName)
         {
            case ImageNameColumnUniqueName:
            case DesignationColumnUniqueName:
            case IdColumnUniqueName:
               e.Column.Display = false;
               break;
            default:
               e.Column.CurrentFilterFunction = GridKnownFunction.Contains;
               e.Column.ShowFilterIcon = false;
               e.Column.ShowSortIcon = true;
               e.Column.AutoPostBackOnFilter = true;
               break;
         }
      }

This is the image column:
private static GridImageColumn _CreateGridImageColumn(string uniqueName)
      {
         GridImageColumn column = new GridImageColumn();
         column.UniqueName = uniqueName;
         column.CurrentFilterFunction = GridKnownFunction.NoFilter;
         column.ShowSortIcon = true;
         column.ShowFilterIcon = false;
         column.AutoPostBackOnFilter = false;
         column.AllowFiltering = false;
         return column;
      }

This is the method where the image is acutally set:
private void _RadGridItemDataBound(object sender, GridItemEventArgs e)
      {
         if (e.Item is GridDataItem)
         {
            GridDataItem item = e.Item as GridDataItem;
 
            string imageName = item[ImageNameColumnUniqueName].Text;
            if (!string.IsNullOrEmpty(imageName))
            {
               GridTableCell imageCell = item[ImageColumnUniqueName] as GridTableCell;
               ((Image)imageCell.Controls[0]).ImageUrl = imageName;
            }
         }
      }

The three invisble columns are simple columns which are added to the DataTable which is filled in the
_RadGridNeedDataSource
 method.
Perhaps you can see something which code fragment is erroneous?

Thanks for your help!
0
Iana Tsolova
Telerik team
answered on 19 Sep 2011, 01:50 PM
Hello Jp,

Reviewing your code I cannot find the reason for the unexpected behavior. However, you can open a formal support ticket, send the code in a runnable sample so we perform further debugging on it.

Kind regards,
Iana Tsolova
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Grid
Asked by
JP
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
JP
Top achievements
Rank 1
Share this question
or