日期:2014-05-17  浏览次数:20771 次

DEV gridControl 怎么样自动更改列数据
数据表 USER 中存放部门信息为部门的编号,在通过数据绑定时显示出来的数据也是编号,有什么方法可以显示为部门名称而不是编号?
员工信息和部门列表  分别放在两个List<User>和List<Department>中,
 public class User
    {
        public int ID { get; set; }
        public string UserID { get; set; }
        public string Name { get; set; }
        public int Sex { get; set; }
        public DateTime Birth { get; set; }
        public string IDNumber { get; set; }
        public string Address { get; set; }
        public string Nativeplace { get; set; }
        public string Nation { get; set; }
        public string Domicile { get; set; }
        public string Telephone { get; set; }
        public string Email { get; set; }
        public int Marriage { get; set; }
        public string Education { get; set; }
        public string School { get; set; }
        public DateTime GraduationDate { get; set; }
        public string Specialty { get; set; }
        public DateTime EntryDate { get; set; }
        public Department Department { get; set; }
        public string Duties { get; set; }
        public DateTime Departure { get; set; }
        public string Password { get; set; }
        public int onjob { get; set; }
        public int UserType { get; set; }

    }


 public class Department
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int SuperiorDeptID { get; set; }
    }



            List<User> userList = new List<User>();
            userList =