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

How to save and retrieve Radpivotgrid Layout from sql server

3 Answers 141 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
sanjay
Top achievements
Rank 1
sanjay asked on 05 Feb 2019, 07:52 AM

Hi All,

Can any one let me know how to save and retrieve the layout settings from SQL server .

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 07 Feb 2019, 12:22 PM
Hi Sanjay,

You can use RadPersistenceFramework to achieve this requirement:
https://demos.telerik.com/aspnet-ajax/pivotgrid/examples/applicationscenarios/persisting-radpivotgrid-settings/defaultcs.aspx

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
sanjay
Top achievements
Rank 1
answered on 07 Feb 2019, 01:03 PM

Ya it worked for me. Now i can save and retrieve the Pivotgrid settings from the database. 

Thanks.

 

 

1
Fernando
Top achievements
Rank 2
Iron
answered on 11 Apr 2023, 10:14 PM | edited on 11 Apr 2023, 10:15 PM
RadPersistenceManager1.StorageProviderKey = lblReportId.Text
RadPersistenceManager1.LoadState()

or 

RadPersistenceManager1.StorageProviderKey = lblReportId.Text
RadPersistenceManager1.SaveState()

-------------------------------
 Public Sub SaveStateToStorage(key As String, serializedState As String) Implements IStateStorageProvider.SaveStateToStorage
        Try

            LocalAPI.SavePersistenceManagerSetting(key, serializedState)
        Catch ex As Exception
            Dim e1 As String = ex.Message
        End Try
    End Sub

    Public Function LoadStateFromStorage(key As String) As String Implements IStateStorageProvider.LoadStateFromStorage
        Try

            Return LocalAPI.LoadPersistenceManagerSetting(key)
        Catch ex As Exception
            Dim e1 As String = ex.Message
        End Try
    End Function

--------------------------------
Region "PersistenceManager"
    Public Shared Function LoadPersistenceManagerSetting(key As String) As String
        ' key format:  Id
        Dim ResXML As String
        Try
            Return GetStringEscalar($"select [Value] from Employees_PersistenceManagerSettings where Id={key}")
        Catch ex As Exception
            Throw ex
        End Try

    End Function
    Public Shared Function SavePersistenceManagerSetting(key As String, serializedState As String) As String
        Try
            ' key format: Id
            ExecuteNonQuery($"UPDATE [Employees_PersistenceManagerSettings] SET [Value]='{serializedState}' WHERE [Id]={key}")

        Catch ex As Exception
            Throw ex
        End Try
    End Function
#End Region
Tags
PivotGrid
Asked by
sanjay
Top achievements
Rank 1
Answers by
Eyup
Telerik team
sanjay
Top achievements
Rank 1
Fernando
Top achievements
Rank 2
Iron
Share this question
or