Ticket Q381881
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Appearance rules not effect after call View.SynchronizeWithInfo

End user appearance rule customization

created 13 years ago

Hi,
Is there any way to give end user an interface to customize (add/delete/edit) appearance rules for specific view or object type?
I found several documentations for run time customization of rules via code but those are not enough to fulfill my purpose.
Thanks

Comments (3)
Anatol (DevExpress) 13 years ago

    Hello Ahsan,
    You can create a non-persistent class with properties required to define the appearance rule (Criteria, ObjectType, etc.) and show its DetailView to end-users. Then, when a user clicks OK, create an appearance rule model node (IModelAppearanceRule) based on entered parameters. To create an appearance rule, use the following code:

    C#
    IModelClass modelClass = Application.Model.BOModel.GetClass(nonPersistentAppearancePropertiesHolder.ObjectType); IModelAppearanceRule rule = ((IModelConditionalAppearance)modelClass).AppearanceRules.AddNode<IModelAppearanceRule>(nonPersistentAppearancePropertiesHolder.RuleId);

    Please let me know if you need any further assistance.
    Thanks,
    Anatol

      Hi Anatol,
      I have modified the main demo project with couple of appearance classes and controllers to dynamically add appearance rules.
      I have succeeded to create rules according to your instructions but there are some problem of applying those rules. Appearance does not change at all even after model is reloaded.

      Please check the attached project.
      Thanks

      Dennis Garavsky (DevExpress) 13 years ago

        Hi Ahsan,
        Please pardon our delayed response. We need some additional time to research your project. We will get back to you as soon as we can.
        Thanks,
        Dennis

        Answers

        created 13 years ago

        Hello Ahsan,
        You should modify your code as follows:

        C#
        //View.LoadModel(); AppearanceController appearanceController = Frame.GetController<AppearanceController>(); if (appearanceController != null) { appearanceController.ResetRulesCache(); appearanceController.Refresh(); }

        Further details can be found at Appearance rules not effect after call View.SynchronizeWithInfo.
        Thanks,
        Dennis
        P.S.
        Can I make this ticket public so that other Support Center users could benefit from it? Thank you in advance!

          Show previous comments (7)
          Dennis Garavsky (DevExpress) 9 years ago

            @Willem: I think it is best to repost this question in the corresponding eXpand support forum where support for eXpand Framework is usually provided.

            MS MS
            Mysoft Systems 9 years ago

              Great,
              but i have an issue, when i delete the appearance rule it is removed from the list, bu not from the edit module.

              Dennis Garavsky (DevExpress) 9 years ago

                @Mysoft Systems: Would you please submit a separate ticket in the Support Center and attach your current implementation (a sample project) as well as screenshots illustrating the repro steps and context, because for now it is not quite clear? With that, we will be able to address your problem much faster. Thanks.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.