FireCommandEvent fires NullReferenceException

2 posts, 0 answers
  1. Yazid
    Yazid avatar
    3 posts
    Member since:
    Apr 2015

    Posted 15 Aug 2016 Link to this post


    when I try to perform filter operation in a button event handler the FireCommandEvent method causes an exception.

            protected void Filter_Click(object sender, EventArgs e)
                RadGrid grd = grid;
                grid.MasterTableView.FilterExpression = "([Capture] LIKE 'Kind%')";
                GridColumn column = grid.MasterTableView.GetColumnSafe("Capture");
                column.CurrentFilterFunction = GridKnownFunction.Contains;
                column.CurrentFilterValue = "Kind";
                grd.EnableLinqExpressions = false;
                GridDataItem item = (grid.MasterTableView.GetItems(GridItemType.Item)[2] as GridDataItem);
                item.FireCommandEvent("Filter", new System.Web.UI.Pair("Kind", "Capture"));

    Here is the exception:

    An exception of type 'System.NullReferenceException' occurred in Telerik.Web.UI.dll but was not handled in user code

       at Telerik.Web.UI.GridColumn.RefreshCurrentFilterValue(GridFilteringItem filteringItem, String functionName)
       at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)
       at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
       at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
       at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
       at Lusd.Presentation.LusdApplication.UserControls.Schule.InstitutionsListeControl.Filter_Click(Object sender, EventArgs e) in C:\TFS\ZeGOV\LUSD\Client\development\standard\Presentation\Presentation.LusdApplication\UserControls\Schule\InstitutionsListeControl.ascx.cs:line 429
       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    How can I get it solved?


    Thanks in advance.

  2. Viktor Tachev
    Viktor Tachev avatar
    2497 posts

    Posted 16 Aug 2016 Link to this post

    Hello Yazid,

    I have replied to your query in the other thread you have submitted and suggest we continue the conversation there.

    With that said, please avoid submitting duplicate threads. This way we will be able to keep better track of your support history and provide answers faster.

    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top