1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / DisplayName attribute ignored

DisplayName attribute ignored

7 posts, 1 answered
  1. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    10 Aug 2011
    Link to this post
    Hi,

    Here's the scenario: create an ascx control that you're going to add to the toolbox.
    This control has public properties that make it configurable through the back office, for example:

    private string myProperty = "";
    [Category("My category"), DisplayName("My cool property")]
    public string MyProperty
    {
        get { return this.myProperty; }
        set { this.myProperty = value; }
    }

    However, the "DisplayName" attribute is ignored, and the property will show up as "MyProperty" in the back office.
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    11 Aug 2011
    Link to this post
    Hello Thomas,

    The code building the UI for editing properties does not take into consideration DisplayName attribute. Alternatively, you could implement a control designer for your control. It allows you to specify the UI for the configuration of the control. This way you can provide fields only for the most important properties. You can also provide a user friendly UI for setting complex properties.
    For more details please refer to the following documentation article: Creating the control designer

    All the best,
    Pepi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    11 Aug 2011
    Link to this post
    Hi Pepi,

    Does that mean you don't plan to support the DisplayName attribute in future versions?

    Thanks.
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    11 Aug 2011
    Link to this post
    Hi Thomas,

    I logged this as a feature request for future versions of Sitefinity.

    Kind regards,
    Pepi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    11 Aug 2011
    Link to this post
    Hi Pepi,

    Could you please give me the PITS URL, so I can follow it?

    Thanks.
  6. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    12 Aug 2011
    Link to this post
    Hello Thomas,

    Here is the PITS url: http://www.telerik.com/support/pits.aspx#/public/sitefinity/7369

    Greetings,
    Pepi
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    12 Aug 2011
    Link to this post
    Hi,

    I simply wanted to add that it would be interesting if the [Description()] attribute was supported too.

    Thanks,

    Olivier
7 posts, 1 answered