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

How to Load/save filter value of gridview?

3 Answers 156 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Snehal
Top achievements
Rank 1
Snehal asked on 07 Jul 2010, 05:28 AM
Hello,

How we can save grid filter value into database or any file? & load same setting when loading grid once again?

with search i found RadGridViewSettings.vb but error fired "Type 'DataContractSerializer' is not defined." even if i imported

 

System.Xml.Serialization. I am using VS2010, framework 4 with WPF Telerik controls.

Can i have some example for the same?

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Jul 2010, 07:00 AM
Hello,

 You need to have reference to System.Runtime.Serialization.dll. More info can be found here.

Kind regards,
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
Snehal
Top achievements
Rank 1
answered on 07 Jul 2010, 09:53 AM

Thanks error gone. but having one more problem. while saving a setting it fire a error:

"Unable to determine application identity of the caller."
while reading this as of i understand IsolatedStorageFile for onceclick application not for stand alone application.

 

 

 

 

Anotherthing that i want to save settings in XML file & load from that file only.
so i tried with below while Settings.save() :
Dim writer As New FileStream(strapppath & "\SaveDoc\GridSetting.xml", FileMode.Create)

 

 

 

Dim ser As New DataContractSerializer(GetType(RadGridViewSettings))

 

ser.WriteObject(writer, settings)

writer.Close()

 

 

But when am looking to XML which one created it looklike below:
<RadGridViewSettings xmlns="http://schemas.datacontract.org/2004/07/AmplusDispatchTelerik" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>

So what am doing wrong? why it just 2 lines in XML?

 

0
Snehal
Top achievements
Rank 1
answered on 07 Jul 2010, 10:31 AM
Find solution

replace all GetUserStoreForApplication methods in the RadGRidViewSettings class with GetUserStoreForAssembly calls.

after that it works fine.

Thanks.!!!
Tags
GridView
Asked by
Snehal
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Snehal
Top achievements
Rank 1
Share this question
or