Sorting fields

2 posts, 1 answers
  1. Edward
    Edward avatar
    45 posts
    Member since:
    Aug 2005

    Posted 11 Dec 2012 Link to this post


    Sometimes we need to change the sort order because some clients want a different input order.

    So, I was wondering if (and how)  it possible to adjust the soring order of the fields in code behind. I bind it against an annotated object.

  2. Answer
    Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 14 Dec 2012 Link to this post


    For auto-generated fields, you can assign sorting logic by using the DataAnnotations.Display attribute. Like this:

    [Display(Order = 0)]
            public int StadiumCapacity
                get { return this.stadiumCapacity; }
                    if (value != this.stadiumCapacity)
                        this.stadiumCapacity = value;

    Kind regards,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top