Scheduler causing massive ViewState

8 posts, 0 answers
  1. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 21 Nov 2012 Link to this post

    I'm using the RadScheduler on a DotNetNuke module and for the month of November, the scheduler is binding 3140 appointments. Yes, over 3000 appointments.

    I'm using the logic to filter by the viewable ranges, and administrators need to see all of the appointments for that range. This has led to a massive ViewState size (2.64MB) and that's after gzip compression as well set on IIS.

    With a ViewState that large, it creates a problem for administrators that want to work on their iPad or on their phone over 3G networks, and in some cases even on their PCs. I tried setting EnableViewState = false for the Scheduler, and it almost entirely works.

    There is a scenario where a dropdown on the AdvancedForm user control causes a page postback and effectively breaks the control when the ViewState for the Scheduler is off. If there is any code you can point me to that would potentially let me use jQuery or the Telerik cleint-side methods and wire up to a RadComboBox on the AdvancedForm. I have a cascading dropdown scenario where selecting a value in one box needs to set availability of resources in the dropdown right underneath it.

    As an example, they pick Client A, it makes a roundtrip to the database and says they have secondary resources A,B,C available (postback). If they pick Client B, they may have resources B, D, and E. The availability of these secondary resources needs to be controlled so simple making them all available is also not an option.

    Is there anything else you can recommend in order to minimize the Viewstate size for the Scheduler? Using RadCompression is not an option as we are working with a DotNetNuke instance and it uses a custom provider for compression handling. An acceptable option would be having GetAppointments not return any appointments for an administrator until a filtering option is selected. If there is an example for binding appointments based on a filter without first pulling back all appointments, that would work as well (example: no appointments shown at first, but when Client C is picked, will fetch their appointments using the custom scheduler provider and bind those)

    Thanks in advance

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 12 Dec 2012 Link to this post

    Hi David,

    RadScheduler does not really need ViewState therefore you can safely disable it. On the top of that, you can make use of the RadScheduler WebService binding, which will totally minimize the server-side overhead.

    Regards,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 12 Dec 2012 Link to this post

    From what I remember (and it may not be true), you can't have multiple selected resources with web-service binding? Or was it you can't have custom resources with web-service binding? I"m using a custom data provider as well.

    At the moment, creating a web-service to allow the Scheduler to interact is not a viable solution. It would be perhaps in the future, but not at this moment. Is there anything else that can be recommended?

    Please note the scenario I've posted with the cascading dropdown. That's the only reason it's not working without Viewstate enabled. Is there anyway I can make an AJAX call for a resource dropdown to populate the other resource dropdown?

    Effectively I make all the resources unavailable for that second dropdown, and upon selected index changed of the other dropdown, it clears all the items and repopulates the second dropdown with RadListItems. Can I accomplish this specific scenario using client-side code?

    The postback caused is what wipes out the AdvancedEditForm's values with ViewState turned off on the Scheduler.

  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 17 Dec 2012 Link to this post

    Hello David,

    With respect to your first question, the limitation when using WebServices is that you cannot have grouping by resources.

    Regarding the ViewState problem, can you try the following:

    1) On the Scheduler set EnableViewState to true and ViewStateMode=Disabled
    2) On your user control that holds the advanced form set EnableViewState=True ViewStateMode=Enabled

    Does this solve the problem?


    Regards,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 17 Dec 2012 Link to this post

    The RadScheduler is being used on a DotNetNuke module installation and is not yet up to date to the .NET 4.0 Framework making ViewStateMode unavailable as a property upon build. DNN7 has been moved to the 4.0 Framework and I would be able to try this solution if an upgrade were available.

    Not a solution yet.
  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 19 Dec 2012 Link to this post

    Hello David,

    Actually this should still work. Remember that EnableViewState is not recursive, hence disabling the ViewState on the RadScheduler won't disable the ViewState on the advanced form. I am attaching sample project for reference that follow exactly your scenario.

    Regards,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 19 Dec 2012 Link to this post

    Tried to get the sample to work and keep getting the error

    The database cannot be opened because it is version 706. This server supports version 662 and earlier. A downgrade path is not supported.

    Any ideas? I'm running VS2012 and SQLExpress is 10.0.5500
  8. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010
Back to Top