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()