Saving RadGridView filters/layout to XML

3 posts, 0 answers
  1. Brent
    Brent avatar
    4 posts
    Member since:
    Jun 2012

    Posted 26 Sep Link to this post

    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. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 27 Sep Link to this post

    Hi 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.
  3. Brent
    Brent avatar
    4 posts
    Member since:
    Jun 2012

    Posted 29 Sep Link to this post

    Thank You

    I will try.

Back to Top