I have a situation where i want the border between bands to be dashed. That is, I want the bottom row's border to be dashed and the top row of the child band either blank or dashed as well. Is this possible?
There's no property that will allow you to change only one side of a border style for the row. You would have to use a DrawFilter and draw the border yourself. It would not be a trivial task.
So far, nothing about this has been trivial. Do you have any examples, or a good place to start my research?
I don't know of any samples of exactly what you are trying to do here. It's seems like an odd UI to me - but there is probably some reason for it that I am not privy to. :)
Anyway, if you want to explore using a DrawFilter, I would recommend starting with the Infragistics Knowledge Base. There are lots of articles on DrawFilters with samples. Also, you should get the Infragistics UIElementViewer Utility. It's a big help when working with UIElements.
I was able to make the sample project http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=8487 to color row borders independently. Now, I just need to know if I can apply a draw filter to a single band.
Hi,
The DrawFilter applies to the whole grid. But you should be able to get the band from the UIElement - whatever element that my be - and thus do band specific drawing.
It depends on the element, but I would try calling GetContext on the UIElement and pass in typeof(UltraGridBand). If that doesn't work, you could try UltraGridColumn or UltraGridRow, either of which has a Band property.
I was following a sample that led me astray. The drawphase needed to specify RowUIElement. This is an interesting observer pattern to be able to not only control the context, but also the timing. Anyway, it is working as I need it to now.
if (rowColRegionIntersectionUIElement == null) return DrawPhase.None;
return DrawPhase.AfterDrawElement;
Then,
var ultraGridRow = drawParams.Element.GetContext(typeof(UltraGridRow)) as UltraGridRow;
var bandIndex = ultraGridRow.Band.Index;
if (!(bandIndex == InitiativeActualBandIndex || bandIndex == ProjectActualBandIndex || bandIndex == ElementActualBandIndex)) return false;
if (activeRowUIElement == null) continue;
drawParams.DrawBorders(
. . .
The RowScrollRegion contains the rows and columns and s not related to the band, so you will not be able to get a Band from a RowScrollRegion. A RowScrollRegion could display rows from any number of bands.
You are drawing row borders using the RowScrollRegion element?
UltraGridColumn: Null
UltraGridRow: Null
UltraGridCell: Null
UltraGridBand: Null
No type passed: RowScrollRegion
drawParams.ControlElement.GetContext(typeof(UltraGridColumn)) == null ? "Null" : drawParams.Element.GetContext(typeof(UltraGridColumn)).GetType().Name));