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
120
Why is my UltraGridRow ListObject null after loading a serialized DisplayLayout
posted

I am using an Infragistics UltraGrid in my WinForms application. Infragistics v13.1.

I have recently added code to save grid layouts in a binary serialized format and load them back using the CopyFrom method on the DisplayLayout object.

While I load one of these saved layouts, the grid is modified appropriately and data still shows correctly in the grid, but any time I ask for a ListObject on a row, it returns null. The datasource for the grid is a BindingSource whose DataSource is a BindingList (this data is not changed when the layout is loaded).

Save:

Dim MS As New IO.MemoryStream()
ugl.Save(MS, Infragistics.Win.UltraWinGrid.PropertyCategories.All)
Return MS.ToArray()

Load:

Private Function ConvertToUltraGridLayout(data As Byte()) As UltraGridLayout
    Dim ugl As New UltraGridLayout()
    Dim MS As New IO.MemoryStream(data)
    MS.Seek(0, IO.SeekOrigin.Begin)
    ugl.Load(MS, Infragistics.Win.UltraWinGrid.PropertyCategories.All)
    Return ugl
End Function

dgrServices.DisplayLayout.CopyFrom(ConvertToUltraGridLayout(lOption.Layout))

What do I need to do to get the ListObject to be non-null?

Thanks!

Parents
No Data
Reply
  • 7535
    Offline posted

    Hello Robert,

    Thank you for posting you our forum.

    There could be multiple reasons because of that ListObject is null:

    1) The row you are looking at is some old row that is no longer in the grid.

    2) Another reason the ListObject might be null is for some "special" rows like the FilterRow, for example. So maybe your layout is turning on the FilterRow and so that would be correct.

    3)There might have been a bug with 2013 Volume 1 that has since been resolved and you should test your application with 2018 Volume 1 to see if the same behavior is still reproduced

    If you still getting the issue, the best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally.

    Please let me know if you need further assistance.

Children