当前位置: 首页 > news >正文

百度广告 网站域名 已验证怎么做一个网站推广

百度广告 网站域名 已验证,怎么做一个网站推广,建投商务网登录,网站建设氺首选金手指14此教程示范如何添加TreeListControl到项目和绑定控件自引用数据源: 添加数据模型 绑定tree,并添加如下字段到数据源对象: Key字段包含唯一值索引节点 Parent字段包含父索引节点 添加数据模型(Employee和Staff类)到…

此教程示范如何添加TreeListControl到项目和绑定控件自引用数据源:

添加数据模型

绑定tree,并添加如下字段到数据源对象:

Key字段包含唯一值索引节点

Parent字段包含父索引节点

添加数据模型(Employee和Staff类)到MainWindow.xaml.cs 文件:

namespace DxTreeListGettingStarted {public partial class MainWindow : Window { ... }public class Employee {public int ID { get; set; }public int ParentID { get; set; }public string Name { get; set; }public string Position { get; set; }public string Department { get; set; }}public static class Staff {public static List<Employee> GetStaff() {List<Employee> staff = new List<Employee>();staff.Add(new Employee() { ID = 0, Name = "Gregory S. Price", Department = "", Position = "President" });staff.Add(new Employee() { ID = 1, ParentID = 0, Name = "Irma R. Marshall", Department = "Marketing", Position = "Vice President" });staff.Add(new Employee() { ID = 2, ParentID = 0, Name = "John C. Powell", Department = "Operations", Position = "Vice President" });staff.Add(new Employee() { ID = 3, ParentID = 0, Name = "Christian P. Laclair", Department = "Production", Position = "Vice President" });staff.Add(new Employee() { ID = 4, ParentID = 0, Name = "Karen J. Kelly", Department = "Finance", Position = "Vice President" });staff.Add(new Employee() { ID = 5, ParentID = 1, Name = "Brian C. Cowling", Department = "Marketing", Position = "Manager" });staff.Add(new Employee() { ID = 6, ParentID = 1, Name = "Thomas C. Dawson", Department = "Marketing", Position = "Manager" });staff.Add(new Employee() { ID = 7, ParentID = 1, Name = "Angel M. Wilson", Department = "Marketing", Position = "Manager" });staff.Add(new Employee() { ID = 8, ParentID = 1, Name = "Bryan R. Henderson", Department = "Marketing", Position = "Manager" });staff.Add(new Employee() { ID = 9, ParentID = 2, Name = "Harold S. Brandes", Department = "Operations", Position = "Manager" });staff.Add(new Employee() { ID = 10, ParentID = 2, Name = "Michael S. Blevins", Department = "Operations", Position = "Manager" });staff.Add(new Employee() { ID = 11, ParentID = 2, Name = "Jan K. Sisk", Department = "Operations", Position = "Manager" });staff.Add(new Employee() { ID = 12, ParentID = 2, Name = "Sidney L. Holder", Department = "Operations", Position = "Manager" });staff.Add(new Employee() { ID = 13, ParentID = 3, Name = "James L. Kelsey", Department = "Production", Position = "Manager" });staff.Add(new Employee() { ID = 14, ParentID = 3, Name = "Howard M. Carpenter", Department = "Production", Position = "Manager" });staff.Add(new Employee() { ID = 15, ParentID = 3, Name = "Jennifer T. Tapia", Department = "Production", Position = "Manager" });staff.Add(new Employee() { ID = 16, ParentID = 4, Name = "Judith P. Underhill", Department = "Finance", Position = "Manager" });staff.Add(new Employee() { ID = 17, ParentID = 4, Name = "Russell E. Belton", Department = "Finance", Position = "Manager" });return staff;}}
}

添加视图模型

创建视图模型暴露Employees字段:

using DevExpress.Mvvm;namespace DxTreeListGettingStarted {public partial class MainWindow : Window { ... }public class Employee { ... }public static class Staff { ... }public class MainWindowViewModel : ViewModelBase {public MainWindowViewModel() {Employees = Staff.GetStaff();}public List<Employee> Employees { get; private set; }}
}

设置window数据上下文到视图模型:

<Window... ><Window.DataContext><local:MainWindowViewModel/></Window.DataContext>

添加TreeListControl到视图

拖动TreeListControl组件从工具箱到form里面

选择TreeListControl点击Quick Actions

点击重新计算按钮到ItemsSource属性调用上下文菜单。选择创建数据绑定

选择Employees在对话框点击OK

设置AutoGenerateColumns添加AddNew

切换到XAML视图,定义TreeListControl 视图:

<dxg:TreeListControl AutoGenerateColumns="AddNew" ItemsSource="{Binding Employees}"><dxg:TreeListControl.View><dxg:TreeListView /></dxg:TreeListControl.View>
</dxg:TreeListControl>

返回设计器视图,选择TreeListView调用Quick Actions

启动AutoWidth和AutoExpandAllNodes选项。指定服务行(TreeListView.KeyFieldName 和 TreeListView.ParentFieldName)生成tree:

<dxg:TreeListControl ItemsSource="{Binding Employees}"AutoGenerateColumns="AddNew" ><dxg:TreeListControl.View><dxg:TreeListView KeyFieldName="ID" ParentFieldName="ParentID"AutoWidth="True" AutoExpandAllNodes="True" /></dxg:TreeListControl.View>
</dxg:TreeListControl>

运行程序

http://www.yayakq.cn/news/264681/

相关文章:

  • 网站开发体会北京网站建设公司艺唯思
  • 景点网站设计与制作wordpress需要多大空间
  • 3小时百度收录新站方法深圳财务小公司网站
  • 眉县网站建设网站建设流程表
  • 北京南站地铁几号线做网站优化有什么方法
  • 小企业做网站有没有用永久免费云电脑
  • 做的好的茶叶网站有哪些陈木胜怎么死的
  • 电商网站开发岗位职责html5网站 欣赏
  • 沈阳做网站的公司打电话说帮忙做网站
  • 谷歌没收录网站主页 301重定向北京seo人员
  • 国外网站推广软件源码论坛wordpress模板
  • 如何创办一个网站第三方物流网站建设
  • 个人备案网站放什么资料中国经济网
  • 网站设计 psdwordpress虚拟物品销售
  • 建一个分类信息网站检察院门户网站建设自查报告
  • 360网站怎么做wordpress 仿微博
  • 优酷视频放到网站上怎么做网络会议系统有哪些
  • 国内永久免费crm系统网站推荐大全中南集团中南建设网站
  • wordpress 首页浏览量统计百度快速优化软件
  • 中国建设银行网站特色北理离线《网站开发与应用》
  • 卡片式网站合肥网站建设价格
  • 无锡网站排名优化公司哪家好泉州网站建设 首选猴子网络
  • 想做网站找哪个公司好网站域名设计
  • 注册一个网站要多少费用江苏设计网站电话
  • 365元做网站做一个微信小程序
  • seo网站优化专家住建房官网查询
  • 简约大方自助建站模板Wordpress动静态分离
  • 集团网站 备案大连大家营销
  • phpcms 生成网站地图免费做网站怎么做网站吗2
  • 贵州网站建设设计公司南和信息港