コード例 #1
0
        void ShowTreeView()
        {
            var list = EnumHelper.ConvertEnumToList <int>(typeof(UserType));

            //var list = dc.system_user.GroupBy(x => x.user_type).ToList();
            foreach (var item in list)
            {
                NodeData n = new NodeData();
                n.Name = item.Description; //device_id
                n.Id   = item.Value;       //device_id
                roots.Add(n);
            }
            treeView1.ItemsSource = roots;
        }