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
280
Losing styles on Ultrawebgrid header in UpdatePanel
posted

I have an ultrawebgrid in an updatepanel that contains layered headers. For example I have

                   Dressings                                               Croutons

Blue Cheese          Ranch       French                 Seasoned              Unseasoned

 

The intial data load and display is exactly how I want it, however, when I click on the "Blue Cheese" header to sort, it sorts, but I lose the style on only

the "Dressings" header column. It just turns to white with black text. All other headings retain their styles, sizes, etc.... If I continue

to sort it eventually shrinks to only cover the Blue Cheese column and the "Croutons" headings moves over. This is only happening to the very first

main header. The "Croutons" header retains its stylings and column spans...until the grid is sorted multiple times it still retains its style but moves over when the

"Dressings" header shrinks. I have tried taking the grid out of the update panel and having it sort by postback. Same result. All my grid style, sort, span and size settings are done in the

the Server side InitializeLayout event. Has anyone else experienced this loss of styling, and or column size? Its a brain twister.

Here's some sample code if you can spot something I'm not seeing.

 

Dim DressingColumn As UltraWebGrid.ColumnHeader
        Dim CroutonColumn As UltraWebGrid.ColumnHeader
        Dim iColumn As Integer
        Try

            With uwgData
                .DisplayLayout.AllowSortingDefault = UltraWebGrid.AllowSorting.Yes
                .DisplayLayout.HeaderClickActionDefault = UltraWebGrid.HeaderClickAction.SortSingle
                .DisplayLayout.UseFixedHeaders = True
                .Height = Unit.Pixel(400)
                .DisplayLayout.RowSelectorsDefault = UltraWebGrid.RowSelectors.No
            End With

            'Add the larger headings that encapusulate the other headings
            With e.Layout.Bands(0) 'uwgData
                'Set up multi column header
                DressingColumn = New UltraWebGrid.ColumnHeader
                DressingColumn .Caption = "Dressing"
                DressingColumn .RowLayoutColumnInfo.OriginY = 0
                DressingColumn .RowLayoutColumnInfo.OriginX = 0
                DressingColumn .RowLayoutColumnInfo.SpanX = 3
                DressingColumn .Style.CssClass = "FixedColumnHeader"
                DressingColumn .Style.HorizontalAlign = HorizontalAlign.Center
                .Columns.Band.HeaderLayout.Add(DressingColumn)
                'End Item Columns
                CroutonColumn = New UltraWebGrid.ColumnHeader
                CroutonColumn.Caption = "Crouton"
                CroutonColumn.RowLayoutColumnInfo.OriginY = 0
                CroutonColumn.RowLayoutColumnInfo.OriginX = 3
                CroutonColumn.RowLayoutColumnInfo.SpanX = 2
                CroutonColumn.Style.CssClass = "FixedColumnHeader"
                CroutonColumn.Style.HorizontalAlign = HorizontalAlign.Center
                .Columns.Band.HeaderLayout.Add(CroutonColumn)
            End With

            'Blue Cheese
            With uwgData.Columns.FromKey("BlueCheese")
                .Header.RowLayoutColumnInfo.OriginY = 1
                .Header.Caption = "Blue Cheese"
                .AllowResize = UltraWebGrid.AllowSizing.Free
                .Width = Unit.Pixel(60)
            End With

            'Ranch
            With uwgData.Columns.FromKey("Ranch")
                .Header.Caption = "Ranch"
                .Header.RowLayoutColumnInfo.OriginY = 1
                .AllowResize = UltraWebGrid.AllowSizing.Free
                .Width = Unit.Pixel(60)
            End With

            'French
            With uwgData.Columns.FromKey("French")
                .Header.Caption = "French"
                .Header.RowLayoutColumnInfo.OriginY = 1
                .AllowResize = UltraWebGrid.AllowSizing.Free
                .Width = Unit.Pixel(60)
            End With

            'Seasoned
            With uwgData.Columns.FromKey("Seasoned")
                .Header.Caption = "Seasonsed"
                .Header.RowLayoutColumnInfo.OriginY = 1
                .AllowResize = UltraWebGrid.AllowSizing.Free
                .Width = Unit.Pixel(60)
            End With

            'Unseasoned
            With uwgData.Columns.FromKey("Unseasoned")
                .Header.Caption = "Unseasoned"
                .Header.RowLayoutColumnInfo.OriginY = 1
                .AllowResize = UltraWebGrid.AllowSizing.Free
                .Width = Unit.Pixel(60)
            End With


            With uwgData
                ''Set headers to fixed
                For iColumn = 0 To .Columns.Count - 1
                    .Columns(iColumn).Header.Fixed = True
                Next

                .DisplayLayout.TableLayout = UltraWebGrid.TableLayout.Fixed
                .DisplayLayout.StationaryMargins = Infragistics.WebUI.UltraWebGrid.StationaryMargins.Header

                .DisplayLayout.RowAlternateStyleDefault.CssClass = "AlternateRow"
                .DisplayLayout.RowAlternateStyleDefault.BorderWidth = Unit.Pixel(1)
                .DisplayLayout.RowAlternateStyleDefault.BorderStyle = BorderStyle.Solid

                .DisplayLayout.FixedHeaderStyleDefault.CssClass = "FixedColumnHeader_Sort"
                .DisplayLayout.FixedHeaderStyleDefault.BorderWidth = Unit.Pixel(1)
                .DisplayLayout.FixedHeaderStyleDefault.BorderStyle = BorderStyle.Solid

            End With.