How do SaveLayout() and LoadLayout() work?

5 posts, 0 answers
  1. Dave Gasner
    Dave Gasner avatar
    3 posts
    Member since:
    May 2008

    Posted 07 Jan 2009 Link to this post

    Maybe I'm crazy, or maybe I'm blind, but I can't seem to find a good example on how to get the LoadLayout to work.

    I have a grid, and I save the layout to a file, using SaveLayout(fileName), but then when I go to load it, the method throws the exception:

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index


    I figured that I was just doing it incorrectly, but when I went to look for an example of some sort, I couldn't find one.
    Can someone please help me out with this.

    Thanks
    Davey
  2. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 07 Jan 2009 Link to this post


    Make sure Data Bind occurs before LoadLayout().

    However, there are probably still some issues with specific complex grid layouts. Basic grids seem to work quite well (tested quite a bit with 2008Q3SP1).

    If things do not work out, please post more information / code snipped on how you set up the grid.

    Regards Erwin




  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dave Gasner
    Dave Gasner avatar
    3 posts
    Member since:
    May 2008

    Posted 08 Jan 2009 Link to this post

    Ok, so before posting a bunch of code, I thought I'd ask some questions to maybe fill me in on what "exactly" SaveLayout and LoadLayout can actually do.

    I build my columns dynamically in my grid.  I was hoping that instead of building my own logic to store the column info, sort info, and grouping info, and then later try and go get it and apply it to my grid (as I've done in ASPX), I could just do the SaveLayout() LoadLayout().

    Are my wishes far above what the SaveLayout() and LoadLayout() can do?

    Thanks
    Davey
  5. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 09 Jan 2009 Link to this post

    Dave,

    That's exactly what these functions are meant to do (if they work).
    I have no experience with these functions with manually set-up grids, only with grids that use databinding.

    Some more fine-grained control of exactly what aspects of the grid are saved is currently lacking or at least undocumented.

    Regards
    Erwin
  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 13 Jan 2009 Link to this post

    Hi guys,

    Erwin, thank you for your feedback and cooperation.

    Dave Gasner, as Erwin mentioned, the purpose of the Save/Load Layout feature is to persist RadGridView properties. For additional information, please refer to the following forum thread:
    http://admin.telerik.com/default.aspx?Context=Support&Control=~/UserControls/Support/ThreadReply.ascx&ST=181676&SM=0

    As mentioned there, you will provide documentation soon.

    There is a good example of the regarded feature in our Quick Start Framework application (a.k.a. Examples), section RadGridView >> Save/Load Layout.

    Dave Gasner, if you continue experiencing the issue described at the beginning of this thread, please open a new support ticket and send me a sample project which reproduces it. This will allow me to help you further.

    Kind regards,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready