I have created a class that I use to implement expansion indicators in grid column headers. Expanding shows related columns and collapsing hides them. This works without any issues. The objects inherits from Infragistics.Win.ExpansionIndicatorUIElement.
The look of the expansion indicator is not quite right. I looked at the source code and tried to follow it, but I think I am falling short on the implementation of the UIRole. In the ExpansionIndicatorUIElement source code it is just a single line of code:
return StyleUtils.GetRole( this.Row.BandInternal, StyleUtils.Role.ExpansionIndicator );
StyleUtils is not accessible and I am not sure what I am supposed to call to get the role. I tried this:
GetUIRole(AppStyling.UIRoleNames.ExpansionIndicator)
But either that does not translate to the same or I am missing something else.
Here is how the expansion indicators look. On top is my object in the column headers and below is the grid's row expansion indicators:
Can anybody point me in the right direction? Maybe there is some example available that properly implements styling in an object like the one I am inheriting from?
Do you know that the grid has Built-in support for collapsing groups with an expansion indicator?
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { var layout = e.Layout; var band = layout.Bands[0]; var ov = layout.Override; ov.AllowGroupCollapsing = DefaultableBoolean.True; }
I mostly lost interest in this one as the project took a turn that will not require this.
But just to complete this. If I do not try to set a role I get expansion indicator that looks almost right. with some styles it seems to come out OK while with others it's not quite there. As far as I could see it seemed to me that the role I was using was wrong.
In the application that I was converting the grids are basically pivot grid. I went down the rabbit hole of trying to use Infragistics pivot grid bound to flat data source. That worked, but had many limitations, hence I tried to implement one using the standard grid.
Here is an example of original application:
I was anticipating to use the column groups for anything above the lowest level. In this example the lowest level is all groups expanding on same level. It often is a mix of groups and fields on same level. I wanted to try to keep that, hence expansion indicators in the columns.
Well, I guess you are saying you no longer need this. But just FYI, if you set RowLayoutStyle on the band to GroupLayout, it is possible to have nested groups in the grid. And that feature is compatible with CollapsibleGroups. :)