Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
458
Styling certain controls differently in the same app
posted

We are just getting off the ground with Infragistics, so this is probably a beginner-level question...

 

How do we have multiple styles for a given control type in a single application.  For example, we want to have certain ultraLabels styled one way, and certain ultraLabels styled a different way.  We can't find anything in AppStylist that seems to support this basic functionality, nor can I find any documentation on this.  For a simplistic example, we want some labels bold, and some not.  Obviously we can set this manually in the control properties, but we want to style it with a StyleSet to allow us to make 1 easy change which affect the whole application.

 

How is this best accomplished?

 

Thanks,

Bill

  • 469350
    Verified Answer
    Offline posted

    Hi Bill,

    There are a number of ways you can do this. The Infragistics controls all have a property called StyleSetName. So you could assign a StyleSetName to some of your UltraLabels. This is just a string that identifies which StyleSet in the Style Library the control will use. Then when you create your ISL, you use the Default StyleSet for UltraLabels in general, and create a new StyleSet that has the settings you want for the other labels.

    In the latest version, the controls also have a StyleLibraryName property. So you can load multiple ISL files into memory at once and each one will only affect the controls with the same time. Controls will no StyleLibraryName will use the default (un-named) style library you load. 

    Still a third way to do this is via a resource. The Appearance object has a property called StyleResourceName. So you could create a Resource in your style library and then use the name of that resource to apply an appearance to a specific object.