Ticket T359882
Visible to All Users

How to colorize (make red) the asterisk symbol accompanying captions of required fields

created 9 years ago

[DevExpress Support Team: CLONED FROM T356223: Not able to get DetailViewItem from LayoutItemTemplateContainer]
Hi Dennis,

How we can change asterisk to red color for required field instead of black default color in above post?
Please provide any sample for v15.2.

Comments (2)
Dennis Garavsky (DevExpress) 9 years ago

    If I understand you correctly, you want to have the following result in the application UI, correct?

      HI Deepak
      If you have EnableHtmlForating = True in your Model->Options
      then you can do the following in LayoutManagerOptions->RequiredFieldMark set the value to

      <b><color=#fb8c3c><size=11>*</size></color></b>

      That will do the trick for you just change the color value to any color you require

      Answers approved by DevExpress Support

      created 9 years ago (modified 9 years ago)

      Hello,

      To accomplish this task, follow the instructions below. While the underlying implementation is different for Windows and the Web, the idea is the same - use DevExpress specialized or native HTML tags to format the label's text or required field mark text.

      WinForms:

      1. Invoke the Model Editor for YourSolutionName.Win/Model.XAFML file;
      2. Under the Options node, set the EnableHtmlFormatting property to True;
      3. Under the Options | LayoutManagerOptions node, set the RequiredFieldMark property to <b><color=red>*</color></b>
        Note: since the layout is managed with the help of the LayoutControl, we are using the built-in HTML Text Formatting feature of our WinForms Controlsfor this task.

      ASP.NET:

      1. Invoke the Model Editor for YourSolutionName.Web/Model.XAFML file;
      2. Under the Options | LayoutManagerOptions node, set the RequiredFieldMark property to <b><font color="red">*</font></b>
        Note: since the layout item captions are rendered with the help of the standard System.Web.UI.WebControls.Literal control, according to MSDN, we can use standard HTML tags in the label's text.

        Show previous comments (3)
        DevExpress Support Team 8 years ago

          Hello Bryan,

          I've created a separate ticket on your behalf (T476398: The T359882 not working on the first visit to a page). It has been placed in our processing queue and will be answered shortly.

          YD YD
          Yartik Dhameliya 3 years ago

            Hello,

            I am using v21.1.4 and I want to implement same thing(want to change asterisk * default black color to red) in XAF Blazor, so is there any specific way to perform this task?

            I have try some of the solutions from this ticket but unfortunately I got unexpected result.

            Clipboard-File-1.png
            Clipboard-File-2.png

            DevExpress Support Team 3 years ago

              Hello,

              I created a separate ticket on your behalf: T1031748: XAF Blazor - How to colorize the asterisk symbol. We placed it in our processing queue and will process it shortly.

              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.