Hi
After saving then loading my grid's layout my Excel style row filters changed back to the old style.Using VS QuickWatch I noticed that the value of FilterUIProviderResolved was Nothing after loading my grid's layout using grid.DisplayLayout.LoadFromXml(strm, PropertyCategories.All).
Prior to loading, the layout had been saved using grid.DisplayLayout.SaveAsXml(strm, UltraWinGrid.PropertyCategories.All). Immediately prior to saving I checked the value of FilterUIProviderResolved which was Infragistics.Win.SupportDialogs.FilterUIProvider.UltraGridFilterUIProvider.
The result is that I lose the Excel style filtering after the saved layout is loaded - could some one please advise on why this value does not persist or provide a workaround.
Many thanks.
Hello,
I am just checking about the progress of this issue. Let me know If you need any further assistance on this issue?
Thank you for using Infragistics Components.
I am having this same issue. Whenever I save my grid layout, I lose the Excel-style filter row. Can you tell me how to reset this when I load my grid layout?
Rich
Hi,
The easiest thing to do is to assign the FilterUIProvider to Override object inside the InitializeLayout event of the grid. This event fires when you load a layout, so then you will not have to worry about it.
Can you give me a VB example of this? I'm not sure what object I'm supposed to setting the FilterUIProvider to.
You set it to the same thing you are setting it to, now - an instance of the UltraGridFilterUIProvider component.
Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout Dim layout As UltraGridLayout = e.Layout Dim ov As UltraGridOverride = layout.Override ov.FilterUIProvider = Me.UltraGridFilterUIProvider1 End Sub
Mike,
I have the following code
LayoutArray = CType(oDataset.Tables(0).Rows(0)("GridLayout"), Byte())Dim MS As New IO.MemoryStream(LayoutArray)ugridSearchResults.DisplayLayout.Load(MS, PropertyCategories.All)
the line ugridSearchResults.DisplayLayout.Load(MS, PropertyCategories.All) is not triggeing the ugridSearchResults_InitializeLayout(sender As Object, e As InitializeLayoutEventArgs) Handles ugridSearchResults.InitializeLayout event
Iam using the lastest version nd service pack of the controls. Any suggestions please?
I don't think loading a layout is supposed to fire the InitializeLayout event. I can't see why you would want that to happen, anyway. InitializeLayout is for you to Initialize the layout in code and it fires when you bind the grid. If anything, a more common usage would be to handle the InitializeLayout and load a layout from inside that event - which would make it a bad idea for the load to re-fire the event because you would get stuck in a loop.
If you have code in InitializeLayout that you want to fire and modify the layout after you load one, then I recommend that you move that code into a helper method and call it both from inside InitializeLayout and also after loading your layout.