Adding telerik:RadDatePicker in GridView and exporting to excel

2 posts, 0 answers
  1. Michael Epley
    Michael Epley avatar
    13 posts
    Member since:
    May 2010

    Posted 21 Oct 2015 Link to this post

    I have added telerik:RadDatePicker in a gridView. Its fetching results and calender as expected. But when i am exporting to excel. I am getting error.

     

    Server Error in '/' Application.

    Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

    Source Error: 

    Line 121: Line 122: // render the table into the htmlwriter Line 123: table.RenderControl(htw); Line 124: Line 125: // render the htmlwriter into the response
    Source File: \App_Code\GridViewExportUtil.cs    Line: 123 

    Stack Trace: 

    [InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.] Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control) +161 Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors() +39​

     

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Oct 2015 Link to this post

    Hello,

    The mentioned error most commonly appear if the control is not properly added in the controls collection of the Page or the controls collection of any other control already added to the Page. I believe in your case you are adding the DatePicker dynamically and for some reason this issue appears.
    Can you pleas share your page markup as well as related code behind so that we can revise them locally and advise you further?

    Regards,
    Maria Ilieva
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top