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

Saving RadGridView filters/layout to XML

2 Answers 160 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 1
Brent asked on 26 Sep 2017, 02:02 PM

I'm able to save a RadGridView's properties(filters and layout) to XML and I store that XML in a SQL table(not a file).
However how do I apply the XML from SQL back to the grids layout? I can apply the layout when in file format but I'm not smart enough to figure out how to apply when in SQL format.

 

Again any help would be appreciated.

Brent

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 27 Sep 2017, 05:43 AM
Brent,

The following snippet shows how you can load the layout from a string:
Private layout As String
Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Using ms = New MemoryStream()
        radGridView1.SaveLayout(ms)
        ms.Position = 0
        Dim sr = New StreamReader(ms)
        layout = sr.ReadToEnd()
    End Using
End Sub
 
Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
    Using ms = New MemoryStream()
        Dim sw As New StreamWriter(ms)
        sw.Write(layout)
        sw.Flush()
        ms.Position = 0
        radGridView1.LoadLayout(ms)
    End Using
End Sub

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Brent
Top achievements
Rank 1
answered on 29 Sep 2017, 07:10 PM

Thank You

I will try.

Tags
General Discussions
Asked by
Brent
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Brent
Top achievements
Rank 1
Share this question
or