Hello
I have upgraded my version from 2019 R3 to 2020 R3 and have found that the GridView layouts saved in the old version will not longer load in the new version.
Here is my existing code:
string layout; // loaded from file
PersistenceManager manager =
new
PersistenceManager();
byte
[] byteArray = Encoding.ASCII.GetBytes(layout);
MemoryStream stream =
new
MemoryStream(byteArray);
manager.Load(
this
.RadGridView, stream);
When trying to load the layout it fails with:
Exception thrown: 'System.NullReferenceException' in Telerik.Windows.PersistenceFramework.dll Object reference not set to an instance of an object.
If have tried enabling AllowCrossVersion, but this then fails with:
Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll
The only way I can get it to work is by following the recommendation in this post Here, it then loads as expected and without any errors:
PersistenceManager manager =
new
PersistenceManager();
byte
[] byteArray = Encoding.ASCII.GetBytes(
this
.layout.Replace(
"Version=2019.3.1023.45"
,
"Version=2020.3.1020.45"
));
MemoryStream stream =
new
MemoryStream(byteArray);
manager.Load(
this
.RadGridView, stream);
This isn't a satisfactory fix in the long run. Could you please advise how I should be handling this?
Thanks
Dave