GithubHelp home page GithubHelp logo

devexpress-examples / xaf-how-to-dynamically-change-mask-settings-based-on-the-current-object Goto Github PK

View Code? Open in Web Editor NEW
0.0 55.0 0.0 371 KB

How to dynamically change mask settings based on the current object

License: Other

C# 73.65% HTML 26.35%
dotnet xaf framework ef-core expressapp expressapp-framework expressappframework

xaf-how-to-dynamically-change-mask-settings-based-on-the-current-object's Introduction

XAF - How to dynamically change mask settings based on the current object

This example demonstrates how to change mask settings of a certain editor dynamically (for example, based on properties of the current object).

example

Implementation Details

There are two ways to implement this functionality:

  1. Implement a ViewController that handles events of the current view and changes settings of required editors, as shown in the following topic: Access the Settings of a Property Editor in a Detail View.
  2. Implement a custom Property Editor (for example, a descendant of the corresponding built-in property editor) and change settings of the associated underlying control. For more information, refer to the following help section: Property Editors.

This example demonstrates the first approach. To implement it, the following classes are added:

  • DemoObject - a persistent class with TestString and Mask properties. Mask settings of the TestString property are changed based on the value of the Mask property.
  • ChangeMaskControllerBase - a platform-independent controller that handles events required to update the mask settings at the appropriate time.
  • WinChangeMaskController - a WinForms-specific controller that customizes settings of a WinForms control.
  • BlazorChangeMaskController - a Blazor-specific controller that customizes settings of a Blazor control.

Note that these approaches can be used only for detail views. To implement the same functionality in a ListView, create a ViewController for it and customize its List Editor according to specifics of the List Editor's control (see How to: Access the Grid Component in a List View). For example, in WinForms you can use the GridView.CustomColumnDisplayText event to pass the required text directly to a grid cell. You can also use the GridView.CustomRowCellEdit event to supply editors with different settings for different rows.

Files to Review

Documentation

More Examples

xaf-how-to-dynamically-change-mask-settings-based-on-the-current-object's People

Contributors

albertov05 avatar andreykozhevnikov avatar devexpressexamplebot avatar kill4kan avatar nikolaevairina avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.