I know how to create one multi-column header, but I cannot figure out how to create a 2nd multi-column header. I don't mean a 2nd row. I mean a 2nd multi-column header on the same row as the 1st multi-column header. The code I have that creates the 1st one is:Dim colHead As Infragistics.WebUI.UltraWebGrid.ColumnHeaderDim i As IntegerFor i = 0 Toe.Layout.Bands(0).HeaderLayout.Count - 1colHead = e.Layout.Bands(0).HeaderLayout(i)colHead.RowLayoutColumnInfo.OriginY = 1Next' The boolean parameter inserts this header into viewstate, so that the grid will maintain it over a postback if it is not recreated.Dim ch As New Infragistics.WebUI.UltraWebGrid.ColumnHeader(True)' The caption to include for the unbound columnch.Caption = "Par Favorable"' Set the origin of the element. This will set it up on the first column of the header layout.ch.RowLayoutColumnInfo.OriginX = 5' This will set it on the first row of the HeaderLayout object. The columns created by the control are all on the zeroth row by default.ch.RowLayoutColumnInfo.OriginY = 0' Add the newly created Header object to the HeaderLayout objecte.Layout.Bands(0).HeaderLayout.Add(ch)' Expand the new column header to cover all columns.ch.RowLayoutColumnInfo.SpanX = 3'End of adding a column header that spans across all columns
Hi algunderson,
Glad that the matter has been resolved. Just as an extra bit of information, here is a useful tutorial for getting started with WebDataGrid, should you decide to familiarize yourself with that control:
https://help.infragistics.com/Doc/ASPNET/2011.2/CLR4.0/?page=WebDataGrid_Getting_Started_with_WebDataGrid.html
Please do not hesitate to contact me if you have any further questions.
Thank you for the quick response! I was able to use the code you provided and it worked perfectly. Funny, I actually thought I tried it the same way and I couldn't get it to work...but it's working now.I have actually tried to use the WebDataGrid but I liked the WebGrid better for some reason. I guess I just got used to using the WebGrid and haven't gone back and tried the WebDataGrid again. I definately need to familiarize myself with the WebDataGrid because there are a lot of examples/samples for it.Again, thank you for your quick response!
Thank you for posting in the community.
You can add multiple custom headers in UltraWebGrid - only the OriginX, OriginY and span values need to be modified as needed, for instance:
Please note that the UltraWebGrid control is now outdated and as of .NetAdvantage 2011 Volume 2 is no longer included in our product package. I would suggest that you consider switching to the WebDataGrid/WebHieararchicalDataGrid. More information regarding these controls is available at:
https://help.infragistics.com/Doc/ASPNET/2011.2/CLR4.0/?page=Web_WebDataGrid_WebDataGrid.html
Additional samples demonstrating the features of these grids can be found at:https://ko.infragistics.com/samples/aspnet/
Hope this helps.