LoadLayout removes new columns

4 posts, 0 answers
  1. Grant Fish
    Grant Fish avatar
    10 posts
    Member since:
    Apr 2010

    Posted 19 Jan 2011 Link to this post

    We are having a problem using LoadLayout with RadGrid after releasing a new version that has new columns added. It seems that LoadLayout completely replaces the original columns with those listed in the layout XML file, and the new columns are gone. They are not just hidden, they have been completely removed.

    The only way that we have been able to solve this problem is to rename the XML file with every release, causing the previous saved layout to be ignored. This is very irritating to users because they may have made several changes to the default column layout and after an upgrade they have to start over.

    Is there a way to still use LoadLayout to preserve the user's column and grouping preferences, but not destroy newly added columns?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Jan 2011 Link to this post

    Hello,

    As far as I know, no. The layout will perofrm the layout that is detailed in the XML file. What we tend to do is when load layout is ensure that the layout xml file is not older than the executable. If it is, then we delete it. It means that the user has to re-save a new layout, but it gets over all of these issues.

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Grant Fish
    Grant Fish avatar
    10 posts
    Member since:
    Apr 2010

    Posted 19 Jan 2011 Link to this post

    Using the file dates for the XML and the assembly solves only half of the problem, which we are already solving by appending the version to the XML file name. The main complaint is the need to reset all of the user preferences after every upgrade. We have about 40 customers using our application, and a lot of the columns are specific requests from a single customer. Most users actually want to hide over half of the columns, and everytime we do an upgrade they have to repeat this process.

    If this is just the way it works, then we will have to save all of the individual column and grouping settings as separate values. Not a problem, I was just looking for an easier solution.
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Jan 2011 Link to this post

    Hi again Grant,

    Actually, this has been discussed before and there is actually a sample project available on how to overcome this very issue. Please have a look at this forum thread (linked to answer) which should help you.

    Let me know if you have further questions
    Richard
Back to Top