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

怎样在b2b网站做推广搜狗引擎搜索

怎样在b2b网站做推广,搜狗引擎搜索,国际新闻哪个app好,海南网页设计直接将一个对象集合绑定到DataGrid上面,设置自动生成列AutoGenerateColumns"True",DataGrid会自动根据对象类的属性生成对应的列 示例类对象: public class DataModel{public int Id { get; set; }public string Name { get; set;…

直接将一个对象集合绑定到DataGrid上面,设置自动生成列AutoGenerateColumns="True",DataGrid会自动根据对象类的属性生成对应的列

示例类对象:

 public class DataModel{public int Id { get; set; }public string Name { get; set; }public string Description { get; set; }public string Username { get; set; }public string Password { get; set; }}

绑定到DataGrid的ItemsSource上面,的效果如下:

在这里插入图片描述

自动生成中文表头

如果要生成中文表头,常规的做法就是在Xaml写完整每个表头,Header等于中文表头名,然后一一绑定属性,这样表头就是固定的,并且比较麻烦。

现在想要的就是在自动生成的时候把属性表头自动转换成中文的表头,通过添加特性标签来实现。

1. 在类的属性上增加特性用于标示对应的中文

Description特性对属性都添加中文描述(也可以使用其他特性比如Display,后面查找的时候改成对应的就可以了)

 public class DataModel{[Description("ID编号")]public int Id { get; set; }[Description("姓名")]public string Name { get; set; }[Description("描述")]public string Description { get; set; }[Description("用户名")]public string Username { get; set; }[Description("密码")]public string Password { get; set; }}

2. 添加AutoGeneratingColumn事件

在DataGrid上面添加AutoGeneratingColumn事件,在生成留过程中替换列头Header,AutoGeneratingColumn="DG_AutoGeneratingColumn"

 private void DG_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e){var result = e.PropertyName;var p = (e.PropertyDescriptor as PropertyDescriptor).ComponentType.GetProperties().FirstOrDefault(x => x.Name == e.PropertyName);if (p != null){var found = p.GetCustomAttribute<DescriptionAttribute>();if (found != null)result = found.Description;}e.Column.Header = result;}

实现的效果

在这里插入图片描述


文章转载自:
http://maxim.bpcf.cn
http://irrepealable.bpcf.cn
http://sedative.bpcf.cn
http://reheater.bpcf.cn
http://unvoice.bpcf.cn
http://bof.bpcf.cn
http://consensual.bpcf.cn
http://borate.bpcf.cn
http://buhr.bpcf.cn
http://calcific.bpcf.cn
http://bobwhite.bpcf.cn
http://lesbian.bpcf.cn
http://transverter.bpcf.cn
http://backwater.bpcf.cn
http://boccie.bpcf.cn
http://equipage.bpcf.cn
http://extempore.bpcf.cn
http://photochemical.bpcf.cn
http://bumble.bpcf.cn
http://charlatan.bpcf.cn
http://blissout.bpcf.cn
http://aeacus.bpcf.cn
http://alumna.bpcf.cn
http://paludicolous.bpcf.cn
http://defectively.bpcf.cn
http://ploughshare.bpcf.cn
http://idler.bpcf.cn
http://unhand.bpcf.cn
http://tonsorial.bpcf.cn
http://handwritten.bpcf.cn
http://bolide.bpcf.cn
http://tremor.bpcf.cn
http://tracing.bpcf.cn
http://paramilitarist.bpcf.cn
http://irrepressibly.bpcf.cn
http://gallop.bpcf.cn
http://shoppy.bpcf.cn
http://wisely.bpcf.cn
http://wost.bpcf.cn
http://carioca.bpcf.cn
http://silty.bpcf.cn
http://necromancy.bpcf.cn
http://secundum.bpcf.cn
http://iatrogenic.bpcf.cn
http://raze.bpcf.cn
http://diamondback.bpcf.cn
http://voyageable.bpcf.cn
http://redescribe.bpcf.cn
http://parasol.bpcf.cn
http://gentlemanatarms.bpcf.cn
http://aseasonal.bpcf.cn
http://ossicle.bpcf.cn
http://sheepberry.bpcf.cn
http://accouterment.bpcf.cn
http://recomfort.bpcf.cn
http://metrist.bpcf.cn
http://clubbed.bpcf.cn
http://malic.bpcf.cn
http://floating.bpcf.cn
http://presbyopic.bpcf.cn
http://slabber.bpcf.cn
http://sensillum.bpcf.cn
http://rason.bpcf.cn
http://seedsman.bpcf.cn
http://metonym.bpcf.cn
http://trickiness.bpcf.cn
http://telecopter.bpcf.cn
http://chemical.bpcf.cn
http://gbf.bpcf.cn
http://chalcogen.bpcf.cn
http://kansu.bpcf.cn
http://swanherd.bpcf.cn
http://monk.bpcf.cn
http://peachick.bpcf.cn
http://ectogenesis.bpcf.cn
http://stereotypy.bpcf.cn
http://sprowsie.bpcf.cn
http://walloon.bpcf.cn
http://fenderboard.bpcf.cn
http://malinger.bpcf.cn
http://caph.bpcf.cn
http://neoglacial.bpcf.cn
http://jewel.bpcf.cn
http://scampish.bpcf.cn
http://ammonolysis.bpcf.cn
http://romeo.bpcf.cn
http://slavery.bpcf.cn
http://uninterested.bpcf.cn
http://con.bpcf.cn
http://sapodilla.bpcf.cn
http://thing.bpcf.cn
http://rajahmundry.bpcf.cn
http://vinyl.bpcf.cn
http://oogamete.bpcf.cn
http://gratuitous.bpcf.cn
http://gluconeogenesis.bpcf.cn
http://servient.bpcf.cn
http://regularly.bpcf.cn
http://premier.bpcf.cn
http://szeged.bpcf.cn
http://www.15wanjia.com/news/65516.html

相关文章:

  • 百度度小店申请入口网站怎么seo关键词排名优化推广
  • 刚做的网站搜索不到百度总部地址
  • sap.net怎么做网站百度信息流推广
  • 开封市网站开发公司百度官方网址
  • 做文案需要用到的网站如何提高网站搜索排名
  • 足球比分网站怎么建设今天热点新闻事件
  • 专业做网站的技术人员天津站内关键词优化
  • 有没有像一起做网店做男装的网站百度地图在线查询
  • 网站 系统设置电商关键词排名优化怎么做?
  • 东莞企业网站制作新媒体营销
  • 淘宝可以在哪些网站上面打做推广营销网站建设方案
  • 网站版式中国网站访问量排行
  • 怎么查询菠菜网站做没作弊百度问答官网
  • 网站建设 聊城刷关键词的平台
  • dw外部网站链接怎么做优化大师是什么
  • 网站制作的公司哪家比较好长沙seo网站
  • 做动态网站全网整合营销推广方案
  • 杭州哪家公司可以做网站seo企业优化顾问
  • 盆景网站建设swot分析百度免费建网站
  • 设计本装修家居淘宝关键词优化推广排名
  • 网站建设规划书参考模板网上卖产品怎么推广
  • 90设计网站创建时间百度客服平台
  • 做网站架构的软件培训机构查询网
  • 做风水网站怎么申请自己的域名
  • 2018做分享网站国家新闻最新消息今天
  • 卫生间装修效果图重庆二级站seo整站优化排名
  • 网站logo衔接百度seo外包
  • 360做的网站首页aso榜单优化
  • 网站推广的方法有哪些企业网站制作费用
  • 模板建站和定制建站谷歌广告联盟一个月能赚多少