This is a migrated thread and some comments may be shown as answers.

SaveLayout error

1 Answer 18 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 19 Dec 2011, 08:51 PM
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. 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Dec 2011, 03:28 PM
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.
Tags
GridView
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or