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

Forums / Developing with Sitefinity / Custom control - field/properites ordering

Custom control - field/properites ordering

4 posts, 0 answered
  1. Chris Hayward
    Chris Hayward avatar
    36 posts
    Registered:
    17 Dec 2009
    16 Jun 2010
    Link to this post
    In my custom control i have 4 standard sets of fields that will always be there (a date/fund/distrubution)
    There's also a title for the "box" and a link at the bottom.

    here are my fields

        public string BoxTitle{ get; set; }
        
        public string Date1 { get; set; }
        public string Fund1 { get; set; }
        public string Distribution1 { get; set; }

        public string Date2 { get; set; }
        public string Fund2 { get; set; }
        public string Distribution2 { get; set; }

        public string Date3 { get; set; }
        public string Fund3 { get; set; }
        public string Distribution3 { get; set; }

        public string Date4 { get; set; }
        public string Fund4 { get; set; }
        public string Distribution4 { get; set; }

        [Telerik.Cms.Web.UI.WebEditor("Telerik.Libraries.WebControls.ImageSelector, Telerik.Libraries")]
        public string LinkURL { get; set; }


    Functionality works fine, but when the user selects the custom control in sitefinity, they're in random order and isnt easy to use.

    Is there any way i can specify the order in which these properties appear inside sitefinity?

    thx
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    16 Jun 2010
    Link to this post
    Hello Chris Hayward,

    Ordering control properties will be supported in Sitefinity 4.0 which CTP is available for downloading. In 3.x versions you can use System.ComponentModel.CategoryAttribute to categorize the properties.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Imran
    Imran avatar
    75 posts
    Registered:
    17 Jan 2007
    26 Jul 2010
    Link to this post
    Ivan

    Do you have example code on how to use CategoryAttribute and PropertyOrder?

    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    26 Jul 2010
    Link to this post
    Hi Imran,

    The Category attribute can be used as shown below

    [Category("Behavior")]
       public int Level
       {
           get;
           set;
       }

    Ordering properties is available in 4.0 edition.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered