The article "Draw Filters" in Help shows how to draw a border around a specified edge of a grid cell.
For each cell, I would like to draw a left border, and/or a right border, or no border, depending on which column the cell is in. I could do it if, in the DrawElement method of my draw filter class, I could get a reference to the UltraGridCell that is currently being drawn. I can get a reference to the grid as drawParams.Element.Control, but I can't see how to get a reference to the UltraGridCell.
Any ideas?
I actually used this to solve a somewhat similar problem with an UltraGridDocumentExporter, so my solution might not apply to you.
I included the following in the BeginExport event handler of an UltraGridDocumentExporter, which might be analogous to the InitializeLayout event of an UltraGrid:
e.Layout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.None; e.Layout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.None; e.Layout.Override.RowAppearance.BorderColor = System.Drawing.Color.Transparent; e.Layout.Override.CellAppearance.BorderColor = System.Drawing.Color.Transparent;
I can't say I exactly understand why this worked.
I have had good results with setting BorderColor = System.Drawing.Color.Transparent.