What is the relation between StyleSet and Preset? Thanks!
A big advantage of the Infragistics styling framework is that you can change the look of an entire application by changing one line in the web.config file. It defines the styleset to be used for the entire application. But if I want to add a style for myTable (as you suggest above), I have to add the style to EVERY styleset, right? If I add it to just one styleset (e.g. Electric Blue), then it will only work when I select the Electric Blue styleset. If I change my web.config to use RedPlanet, I will lose the myTable style definition.
"So if tomorrow your boss (or visual design team) comes in and says, "I want all of the fonts in this applicatoin to be Calibri, 12pt, with a color of #3d3d3d", you can make that change in seconds by setting the font properties on the "Control" ui role, which sits at the top of the UI Role Hierarchy."
Wrong. This will affect only the fonts of the Infragistics controls -- not the vast majority of text in the app, which sits inside Div or Table or <p> tags, etc.
Open up the ig_shared.css file from the styleset of your choice. Add a new rule in there like
.myTable{background-color:red;}
Now, you can set the css class of the table to "myTable" and when the styleset is loaded, the table will be shown with a red background.
-Tony
Can you please give an example on number 2?
chrisnet said: Thanks. And more questions: 1. Can I mix StyleSet and Preset? If yes, which one will take control? 2. Does StyleSet apply to non-Infragistics controls/elements? 3. It seems that StyleSet ia an application wide setting. Does it support page-wide or control-wide over-written?
Thanks. And more questions:
1. Can I mix StyleSet and Preset? If yes, which one will take control?
2. Does StyleSet apply to non-Infragistics controls/elements?
3. It seems that StyleSet ia an application wide setting. Does it support page-wide or control-wide over-written?
1. You can mix StyleSets and Presets. The Preset will end up being dominant as it's actually setting control level properties (the control properties will always override the CSS based stylesets)
2. The StyleSet does not automatically apply to non-Infragistics based controls, but since it is nothing more than a CSS StyleSheet, there is no reason you can't add rules for other HTML Elements into the StyleSet stylesheets. You can either add them directly inline, or as I've done in the samples browser, use @import (url) to import rules from a separate stylesheet.
3. Stylesets can be applied application wide through the web.config, at the page-level through the WebPageStyler, or at the control level by using the StyleSetName and StyleSetPath properties. Settings will override as you get closer to the control, so Control overrides page, which overrides application.