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
535
ResouceCustomizer doesn't work
posted

Hi,

I want to customise the resources in the UltraWinGrid....

I have a project where i reference the WPF and WIN Infragistics DLLs

when i use the resourceCustomizer i have an ERROR :: check the attached image.

  • 1980
    Verified Answer
    Offline posted

    Hello Michel,


    This error happens when you have two versions of a DLL that use the same namespaces and class names. You can use external assembly alias to wrap the namespaces from each assembly inside root-level namespaces, which enables them to be used in the same file. So, first you have to specify the ‘Aliases’ property of the .dll references in the following way:


    1. In Visual Studio Solution Explorer, open References folder
    2. Select Infragistics4.Shared.v16.2 reference and right-click on it, select ‘Properties’
    3. Enter alias value in "Aliases" property, for example ‘WinForms’
    4. Select InfragisticsWPF4.v16.2 reference and right-click on it, select ‘Properties’
    5. Enter alias value in "Aliases" property, for example ‘WPF’

    To use the aliases from within a program, reference them by using the extern keyword. Note that the extern aliases should be placed on top of all usings:


    extern alias WinForms;

    extern alias WPF;

    using System.Windows.Forms;

    ...

    Then, in code you specify the alias namespace and class you would like to use the following way:


    WinForms.Infragistics.Shared.ResourceCustomizer rc;
    WPF.Infragistics.Shared.ResourceCustomizer rc1;


    This way the types from each assembly can be referred to without ambiguity by using their fully qualified name, rooted in the appropriate namespace-alias. The rc would be the ResourceCustomizer from Infragistics4.Shared.v16.2
    .dll and rc1 would be the ResourceCustomizer from InfragisticsWPF4.v16.2.


    In your case, I guess you would need only the WinForms ResourceCustomizer rc as you are using the WinForms UltraGrid.