Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Need to capture UltrGrid configuration
posted

Hi,

Let me explain the scenario first..I have an Ultragrid with 10 columns ..After the Winform loads the grid,user can remove or change the order of some of the columns etc. . now i need to store the current configuration of the grid (with the column order changed and with some of the columns deleted etc). so that I can reproduce the same changed grid for the user when he login next time....I am wondering if the Ultragrid configuration could be captured in an Xml file..

Thanks in Advance

Jim

 

 

  • 918
    posted

    Imports system.io 

     "Save Layout"

    Dim FileLayout As New IO.FileStream(My.Application.Info.DirectoryPath & "\CustomerList.ugd", IO.FileMode.OpenOrCreate)

    FileLayout.Seek(0, IO.SeekOrigin.Begin)

    Me.grdList.DisplayLayout.Save(FileLayout, Infragistics.Win.UltraWinGrid.PropertyCategories.All)

    FileLayout.Close()

     

    "Load Layout"

    If My.Computer.FileSystem.FileExists(My.Application.Info.DirectoryPath & "\CustomerList.UGD") Then

    Dim FileLayout As New IO.FileStream(My.Application.Info.DirectoryPath & "\CustomerList.UGD", IO.FileMode.Open)

    FileLayout.Seek(0, IO.SeekOrigin.Begin)

    Me.grdList.DisplayLayout.Load(FileLayout)

    FileLayout.Close()

    sub_LoadGridLayout = True

    Else

    sub_LoadGridLayout = False

    End If

     This should put the file in your app path.  You can save multiple versions if you uniquely indentify them.