Ticket Q487495
Visible to All Users

Change the default value in application model

created 12 years ago

Hi, I'd like to change the default value in application model - specifically a EditMask for all properties of type DateTime from value ‘D’ to value ‘G’ (show time part).
ModelDefault attribute over properties in business class is not for me solution, because I have done applications and properties of type DateTime Too many without this attribute.
Is there a way how to fix this?
Thank you.

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Martin,
You can write domain logic for the IModelMember.EditMask property. Here is an example:

C#
public sealed partial class MainDemoModule : ModuleBase { ... public override void CustomizeLogics(CustomLogics customLogics) { base.CustomizeLogics(customLogics); customLogics.RegisterLogic(typeof(IModelMember), typeof(MyModelMemberLogic)); } } [DomainLogic(typeof(IModelMember))] public class MyModelMemberLogic { public static string Get_EditMask(IModelMember instance) { if (instance.Type == typeof(Double)) { return "c"; } return String.Empty; } }

Please refer to the Extend and Customize the Application Model in Code topic for additional information.

    Comments (2)
    SU SU
    Svatopluk Ulicny 12 years ago

      Thanks, it working.

      Anatol (DevExpress) 12 years ago

        You are welcome!

        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.