We have a Style Library that has a default style for all UltraGrids; e.g.
<styleSet name="Default" useOsThemes="False">
If I want to override this default style I simply set the StyleSetName property to a new style set; e.g.
<styleSet name="UltraGrid_FieldView" useOsThemes="False">
StyleSetName = "UltraGrid_FieldView"
My problem now is I want to be able to set a style for each band. Because there is a default style for all grids, I cannot seem to override the styles at band level; e.g.
<styleSet name="UltraGrid_RailJourneys" useOsThemes="False">
<styleSet name="UltraGrid_ucRailFaresGrid_TicketTypes" basedOn="UltraGrid_RailJourneys" useOsThemes="False">
<styleSet name="UltraGrid_ucRailFaresGrid_Tickets" basedOn="UltraGrid_RailJourneys" useOsThemes="False">
Const TICKETTYPES_STYLESET As String = "UltraGrid_ucRailFaresGrid_TicketTypes"
Const TICKETS_STYLESET As String = "UltraGrid_ucRailFaresGrid_Tickets"
' Apple the complex styles to the bands (Infragistics do not expose the ability to set a style for a band).
With Me.TicketTypes.Override
.CellAppearance.StyleLibraryName = TICKETTYPES_STYLESET
.RowAlternateAppearance.StyleLibraryName = TICKETTYPES_STYLESET
.RowAppearance.StyleLibraryName = TICKETTYPES_STYLESET
End With
With Me.Tickets.Override
.CellAppearance.StyleLibraryName = TICKETS_STYLESET
.RowAlternateAppearance.StyleLibraryName = TICKETS_STYLESET
.RowAppearance.StyleLibraryName = TICKETS_STYLESET
Any ideas how I can achieve my goal of keeping a default style for all the other grids in our application, and being able to assign each band in this grid with styles from the the ISL file?
Thanks, Phil
Oh, ok. I guess I'll have to consider the resource option then. Would be nice to have the ability to apply a style set to a band - I have requested such a feature *fingers crossed*
You cannot specify a StyleSet for each band.
StyleLibraryName allows you to specify a Style Library, not a StyleSet.
To get this to work, You need a completely different style library (a different isl file) for each band.
Or... you could use StyleResourceName on the Appearance to apply a resource that exists in the style library you have already loaded.
Sorry, just explain my code, Me.Tickets and Me.TicketTypes are shortcut references to the two bands I want to apply the styles to.