Hi!
I am trying to figure out how to apply different appearance on each level of the grid, on the GridColumnHeaders and GridRowSelector. See image below, it is apparantly supposed to be possible. In AppStylist, I have created the looks I want as resources, and was thinking to just apply the resource to the properties mentioned above.
BUT - the two properties are common for all levels! There is no way to say "level 1 GridColumnHeader should have resource A" and "level 2 GridColumnHeader should have resource B".
Help!
Hi,
You are probably using the appearance properties on the DisplayLayuot (which apply to the entire grid) instead of the ones on the Band (which apply only to that band).
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Applies to all bands e.Layout.Override.RowSelectorAppearance.StyleResourceName = "My Style"; // Applies only to the individual band (and overrides any settings on the Layout. e.Layout.Bands["My second band"].Override.RowSelectorAppearance.StyleResourceName = "My second band style"; }
You can, in fact, set both. The more specific setting on the band will override the less specific ones on the Layout.
Hi
Thank you for your answer.
Do I understand you correctly, this can only be done programmatically, not on the style library using AppStylist?If it can be done in AppStylist, could you please tell me where I can find settings for Band? I am using AppStylist to set appearance properties. I am not sure what "DisplayLayout" is, if it is something in AppStylist or VS.
Statoil said:Do I understand you correctly, this can only be done programmatically, not on the style library using AppStylist?
AppStylist styles the whole application. It doesn't know anything about individual bands. But you started off saying that you were creating resources and that you wanted to assign those resources to the bands. So I assumed you were already setting the StyleResourceName property in code.
Just to answer your question clearly, you cannot do this without at least some small code changes in the actual application. AppStylist cannot identify an individual band. But you can create the resources in AppStylist and simply assign those resources to the appearances you want in the application. This then allows you to apply different styles to the application by changing the resources in the isl and no further code changes are needed.
Thank you very much. I think you just gave me the last piece of the puzzle :)
I did create resources in AppStylist, and was just looking for somewhere to attach those resources to the bands, anywere is good with me as long as it works.