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

RadGridView.SaveLayout() throws ArgumentException, cannot save settings

3 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 10 Aug 2009, 11:25 AM
Hi,

I am trying without success to serialize the grid's settings using the SaveLayout function.
I call SaveLayout in the FormClosing event. The exception is always the same, and reproducable on different machines and different (sample) projects.

The Argument exception i get is:
The name '(default)' contains characters that are not valid for a Culture or Region. Parameter name: name

which is thrown:
at System.Globalization.CultureTableRecord.ValidateCulturePieceToLower(String testString, String paramName, Int32 maxLength)


My CurrentCulture and my CurrentUICultrue are both "en-US". I was able to make the SaveLayout() work in a sample app that I created from scratch, with nothing in it, no data, no databinding.

However, in my main application, where I add columns programatically, and databind to a Bindingsource, I get this exception. I have been able to remove all properties set in the .designer.cs file so that only the very default settings are used when calling SaveLayout. It seems that if I do NOT add any columns at all to the grid, the SaveLayout() does not throw the exception (but nothing is saved because there is nothing to save, I guess? The resulting XML file is empty save a root node <RadGridView/>). As soon as I add one single column -- which in my case id done during Form.OnLoad -- the exception is thrown.

My grid is readonly, and filtering, grouping is turned off. Editing/deleting rows is done programmatically. There is no context menu, etc. The only thing the user can do, really, is 1.) sort and 2.) change the column widths.

I can reproduce the error with having the Telerik DLLs locally (CopyLocal=true), as well as referencing them in the GAC.
I can reproduce this with 2009 Q1 SP1 and 2009 Q2. My subscription expired before I could test with Q2 SP1.

Any idea?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 10 Aug 2009, 11:58 AM
I just tried the sample app provided by one of your developers via a blog post on April 30. The sample works. I only had to re-reference the DLLs installed in my GAC.

This still doesn't help, though, because the sample is using, for instance, a DataAdapter to fill it with data, which I am not.
0
Tim
Top achievements
Rank 1
answered on 10 Aug 2009, 01:04 PM
I was able to adjust the sample to reflect the way I have been databinding the grid. The SaveLayout() still works.

Then I found a very interesting phenomenon.

In solution1, I have my own sample Project1, which does throw the exception.
In Solution2, I have the Telerik sample, which works.

I added my non-working Project1 to Solution 2. It works!!!!!!!!!!!!!
I added the working Telerik Project to my Solution1. It stopped working!!!!!!!!!!!!!

So, I compared the solution files (only the Project Guid is different), deleted the .suo, cleaned the solutions. Same thing.

What is going on here?
0
Jack
Telerik team
answered on 12 Aug 2009, 11:10 AM
Hi Timothy ,

That's strange. It is possible that you are referencing different assembly versions. Please send us your application files, this way we will be able to make more concrete suggestions. I am looking forward to your reply.

Kind regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Jack
Telerik team
Share this question
or