Hello,
I'm using RadControls for WPF Q1 2010 SP2.
I'm trying to save data from the Gridview with BinaryFormatter. My custom class is marked as serializable and saving List<MyClass> is OK, but when I'm trying to save MyGridView.Items the following error occures:
Type 'Telerik.Windows.Data.WeakEvent+WeakListener`1[[System.ComponentModel.
PropertyChangedEventArgs, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'
in Assembly 'Telerik.Windows.Data, Version=2010.1.603.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7'
is not marked as serializable.
Maybe I'm doing something wrong, so I need help, please.
I'm using RadControls for WPF Q1 2010 SP2.
I'm trying to save data from the Gridview with BinaryFormatter. My custom class is marked as serializable and saving List<MyClass> is OK, but when I'm trying to save MyGridView.Items the following error occures:
Type 'Telerik.Windows.Data.WeakEvent+WeakListener`1[[System.ComponentModel.
PropertyChangedEventArgs, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'
in Assembly 'Telerik.Windows.Data, Version=2010.1.603.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7'
is not marked as serializable.
Maybe I'm doing something wrong, so I need help, please.
5 Answers, 1 is accepted
0
Hi Jokerwolf,
Vlad
the Telerik team
Why not try to get new list from the grid Items and save this list instead? Here is an example:
var list = RadGridView1.Items.OfType<MyClass>().ToList();
Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jokerwolf
Top achievements
Rank 1
answered on 08 Jul 2010, 08:47 AM
No change at all :0) Well, maybe there is another way to save and load data from the GridView?
0
Hi Jokerwolf,
All the best,
Milan
the Telerik team
Before you invoke the BinaryFormatter please try to clear the ItemsSource of the grid and it should work.
this
.myGridView.ItemsSource =
null
;
// invoke formatter
All the best,
Milan
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jokerwolf
Top achievements
Rank 1
answered on 13 Jul 2010, 10:32 AM
That doesn't work, too.
Maybe it is important: We're using WCF service to get the data for gridview.
Maybe it is important: We're using WCF service to get the data for gridview.
0
Jokerwolf
Top achievements
Rank 1
answered on 13 Jul 2010, 11:36 AM
The problem is solved now. We're using XmlSerializer to save and load data.