NullReferenceException using RadFilter in Page_Load

3 posts, 0 answers
  1. Kurtis
    Kurtis avatar
    3 posts
    Member since:
    Apr 2016

    Posted 17 Jun 2016 Link to this post

    Hi, I have a RadFilter that I am trying to add an expression to on the form load. The idea is that when someone clicks a hyperlink on a different page, they are redirected to a different page and the radfilter is set up for them with the data they clicked (in this specific case, it would Select Amends and put in the appropriate value.

    I just want to mention that this code works exactly how I need it to when It is inside of a button click event on the page that gets redirected to.

    The following is called in my page_load:

            pnlSearch.Visible = False
            pnlAdvanced.Visible = True

            Dim amendsByExpression = New RadFilterContainsFilterExpression("Amends")
            amendsByExpression.Value = Session("Search_Text")


    Why does the code above work when its encapsulated inside of a linkbutton click event, but not in the page load? How can I make it work in the Page Load?

  2. Kurtis
    Kurtis avatar
    3 posts
    Member since:
    Apr 2016

    Posted 20 Jun 2016 in reply to Kurtis Link to this post

    Just for more information, my control on the aspx page looks like this:

    <telerik:RadFilter ID="rfAdvancedSearch" runat="server" DataSourceControlID="dsBylaw" FilterContainerID="rgBylaw" SharedCalendarMinDate="1870-01-01" 
                Visible="True" DefaultFieldEditorFieldName="Title" 
                Localization-FilterFunctionLessThanOrEqualTo="Less Than Or Equal To" 
                Localization-FilterFunctionGreaterThanOrEqualTo="Greater Than Or Equal To" 
                Localization-FilterFunctionGreaterThan="Greater Than" 
                Localization-FilterFunctionEqualTo="Equal To" 
                Localization-FilterFunctionLessThan="Less Than" 



  3. Eyup
    Eyup avatar
    3962 posts

    Posted 22 Jun 2016 Link to this post

    Hi Kurtis,

    You can check the following live sample:

    Alternatively, you can try to do that on a different stage of the page life cycle, for example PreRender.

    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