Sort DataGrid based on Foreign key RRS feed

  • Question

  • User1432255915 posted


    What is the easiest way to sort the Grid (not the dropdown box) in the List.aspx based on a foreign key column in the grid?

    This is the Entity

    I am using the DisplayColumn attribute to sort the dropdown boxes but it does not work for the grid.
        [DisplayColumn("FirstName", "FirstName", false)]
        public partial class User
            public override string ToString()
                return FirstName + " " + LastName;
            internal class UserMetaData
                public object FirstName{ get; set; }
                [DisplayName("Last Name")]
                public object LastName{ get; set; }
    Here I have the foreign key User  
    public partial class ITInventory
            public class ITInventoryMetaData
                public object Active;
                [DisplayName("Mobile No")]
                public object MobileNo { get; set; }
                public object User { get; set; }




    Monday, February 18, 2013 7:48 AM

All replies