SaveLayout error

2 posts, 0 answers
  1. Jason Parrish
    Jason Parrish avatar
    87 posts
    Member since:
    Sep 2009

    Posted 19 Dec 2011 Link to this post

    Is this by design?  If I perform a "SaveLayout" and the file already exists but it's HIDDEN flag is set, I get an access denied error.

    Just curious. 

  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 21 Dec 2011 Link to this post

    Hi Jason,

    Thank you for writing.

    This behavior comes from .NET and not from our suite. For more information see here. Overriding hidden files cannot be achieved by either changing the file flags prior writing to it, or by removing the hidden file before writing the new one. Here is one of the approaches:
    private void radButton1_Click(object sender, EventArgs e)
    {
        string file = @"C:\layout.xml";
        if (File.Exists(file))
        {
            File.Delete(file);
        }
        this.radGridView1.SaveLayout(file);
    }

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Regards,
    Stefan
    the Telerik team

    Q3’11
    of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top