Sorting fields

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

    Posted 11 Dec 2012 Link to this post

    Hi,

    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.


    Thanks,
    Edward
  2. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 14 Dec 2012 Link to this post

    Hello,

    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; }
                set
                {
                    if (value != this.stadiumCapacity)
                    {
                        this.stadiumCapacity = value;
                        this.OnPropertyChanged("StadiumCapacity");
                    }
                }
            }

    Kind regards,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top