Save and restore the geometry for a Winforms RadGridView

Saving and restoring grid geometry isn’t glamorous, but it’s one of those small features that makes a WinForms app feel polished and personal. When a user resizes columns, reorders them, or tweaks the layout, they expect the grid to remember it. Telerik’s RadGridView gives you the hooks to capture that state—you just need a clean, reliable way to persist it and bring it back on the next run. In this article, we’ll walk through a practical, production-ready pattern for storing and restoring RadGridView geometry with minimal code and maximum stability.

Saving grid geometry is one of those small touches that makes a WinForms app feel finished. RadGridView already knows how to serialize its layout; all you need is a place to store it. In this pattern, an FPUserSetting record holds the XML for each user and each form, so the grid can rebuild itself exactly the way the user left it.

On load, the code checks for a saved layout, converts the stored XML into a stream, and hands it to LoadLayout. When the user changes the grid, the updated layout is captured with SaveLayout

 

 

Dim oFPUserSetting As FPUserSetting
 

 

'restore grid1 geometry
oFPUserSetting = New FPUserSetting("Geometry", String.Format("{0}RadGridView1", Me.Name), App.UserName, App.Database)
If oFPUserSetting.isPopulated Then
    Dim byteArray As Byte() = Encoding.UTF8.GetBytes(oFPUserSetting.SettingValue)
    Dim ms As MemoryStream = New MemoryStream(byteArray)
    Me.RadGridView1.LoadLayout(ms)
End If

 

Dim swRadGrid As New StringWriter
Dim xw As XmlWriter = XmlWriter.Create(swRadGrid)
Me.RadGrid1.SaveLayout(xw)
xw.Flush()
DynData.SPs.FP_FPUserSetting_Merge("Geometry", String.Format("{0}_RadGridDragAndDrop1", Me.Name), swRadGrid.ToString, App.UserName, App.Database).execute()

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences