Hi,
I am using an Infragistics WinGrid and I need to either 1) Merge the column headers for the left 3 columns, or 2) Simply hide the inner borders for those columns. I do not need any header caption in any of the three columns. Here is how it appears:
What I want is this:
Unfortunately this grid also uses a pre-defined company specific layout which includes a DrawFilter which I'll include below. I suspect that I can modify the DrawFilter to do this but not really sure how:
Public Function DrawElement(ByVal drawPhase As Infragistics.Win.DrawPhase, ByRef drawParams As Infragistics.Win.UIElementDrawParams) As Boolean Implements Infragistics.Win.IUIElementDrawFilter.DrawElement
Case drawPhase.BeforeDrawBorders
Return True
drawParams.DrawBorders(Infragistics.Win.UIElementBorderStyle.Solid, Border3DSide.Right, Rectangle.Inflate(aCellUIElement.Rect, 0, 1))
End Select
Public Function GetPhasesToFilter(ByRef drawParams As Infragistics.Win.UIElementDrawParams) As Infragistics.Win.DrawPhase Implements Infragistics.Win.IUIElementDrawFilter.GetPhasesToFilter
If TypeOf drawParams.Element Is Infragistics.Win.UltraWinGrid.CellUIElement Then
End If
End Function
End Class
Unfortunately the post doesn't show table borders that were overwritten by site's settings, but the first table is supposed to show the left 3 columns with a full outline border, and the 2nd table just an outline border of the left 3 and no inner borders.
It looks like your existing drawfilter is turning off the borders for all cells in the grid and then drawing a sinlge border on the right side of each cell. It seems to be going about it in an odd way - but if it works, why mess with it?
Anyway, you could do something similar by checking for the HeaderUIElement in addition to CellUIElement and modifying the borders of that element. You could probably even just set the BorderSides inside the DrawElement method rather than drawing the borders yourself like you are doing for the cells.
If you want to learn how to use DrawFilters, I recommend checking out the samples and articles in the Infragistics Knowledge Base. Also, get the Infragistics UIElementViewer Utility. It's a big help when working with UIElements.