Ticket T965843
Visible to All Users

ComboBox for MVC - How to set the bold font style for a selected item

created 4 years ago

Dear Support,

with the setting:

Razor
. . . item.NestedExtension().ComboBox(s => { s.ReadOnly = viewMode; s.Properties.DropDownStyle = DropDownStyle.DropDownList; s.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith; s.Properties.DataSource = Model.QualityGates; s.Properties.ItemStyle.Font.Bold = true; . . .

I can see that all my combo box items are shown in bold as expected.
Unfortunately, that setting does not apply to the displayed item after the actual selection.
I can not find any other attribute. Why does the ItemStyle no apply to the displayed item and how can I have that shown in bold as well ?
Thanks
Uwe

Answers approved by DevExpress Support

created 4 years ago

Hello,

If you need to make the font bold for the selected item, use the ControlStyle settings for this purpose:

C#
item.NestedExtension().ComboBox(s => { ... s.Properties.ItemStyle.Font.Bold = true; s.ControlStyle.Font.Bold = true;

Let me know if you need any further help.

    Comments (1)

      Hello Nastya,
      Thanks for your quick response and that simple solution.
      In fact, with this new setting, the other old setting is not even needed anymore.
      Thank you
      Uwe

      C#
      item.NestedExtension().ComboBox(s => { ... // s.Properties.ItemStyle.Font.Bold = true; s.ControlStyle.Font.Bold = true;

      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.