Oct
12
Written by:
Steve Gray
10/12/2010 1:52 PM
This code will allow you to save the way a Janus Grid looks, so your users changes will be persisted.
Dim strAppDataFolder As String
strAppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
strAppDataFolder = Path.Combine(strAppDataFolder, "Devshed")
strAppDataFolder = Path.Combine(strAppDataFolder, "DevshedSQLTools")
'save the grid1 layout
Dim strLayoutDir As String = Path.Combine(strAppDataFolder, Me.Name & "_" & "GridEX1_Layout.gxl")
Dim LayoutStream As FileStream = New FileStream(strLayoutDir, FileMode.Create)
GridEX1.SaveLayoutFile(LayoutStream)
LayoutStream.Close()
'load the grid1 layout file
Try
Dim strLayoutDir As String = Path.Combine(strAppDataFolder, Me.Name & "_" & "GridEX1_Layout.gxl")
Dim LayoutStream As FileStream = New FileStream(strLayoutDir, FileMode.Open)
GridEX1.LoadLayoutFile(LayoutStream)
LayoutStream.Close()
Catch ex As Exception
'don't worry, be happy
End Try