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

梧州网站建设设计网络销售是做什么的

梧州网站建设设计,网络销售是做什么的,wordpress简易商城,做图去哪个网站找素材此主题描述了如何在gridcontrol中的视图模型和显示定义总计和分组统计 在视图模型中指定统计 1、创建 SummaryItemType 枚举你想要在GridControl中显示的统计类型: public enum SummaryItemType { Max, Count, None } 2、创建一个grid统计描述类 public class S…

此主题描述了如何在gridcontrol中的视图模型和显示定义总计和分组统计

在视图模型中指定统计

1、创建 SummaryItemType 枚举你想要在GridControl中显示的统计类型:

public enum SummaryItemType { Max, Count, None }

2、创建一个grid统计描述类

public class Summary : BindableBase {public Summary(SummaryItemType type, string fieldname) {Type = type;FieldName = fieldname;}public SummaryItemType Type { get; }public string FieldName { get; }
}

3、在视图模型中指定合计和分组统计集合

public class CustomersViewModel : ViewModelBase {public CustomersViewModel() {// ...TotalSummary = new ObservableCollection<Summary>() {new Summary(SummaryItemType.Count, nameof(Customer.Name)),new Summary(SummaryItemType.Max, nameof(Customer.Visits))};GroupSummary = new ObservableCollection<Summary>() {new Summary(SummaryItemType.Count, nameof(Customer.Name))};}// ...public ObservableCollection<Summary> TotalSummary { get; }public ObservableCollection<Summary> GroupSummary { get; }
}

如果你需要GridControl引用在TotalSummary和GroupSummary集合中的改变,这些集合必须实现INotifyCollectionChanged 接口

创建统计模板

1、指定一个统计类型(Min,Max,Count),设置SummaryItemBase.SummaryType属性到SummaryItemType枚举值。创建ObjectToObjectConverter来映射SummaryItemType枚举值到SummaryItemType枚举值:

<Window ... xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"><Window.Resources><dxmvvm:ObjectToObjectConverter x:Key="SummaryTypeConverter"><dxmvvm:MapItem Source="Max" Target="Max" /><dxmvvm:MapItem Source="Count" Target="Count" /><dxmvvm:MapItem Source="None" Target="None" /></dxmvvm:ObjectToObjectConverter></Window.Resources><!-- ... -->
</Window>

2、创建一个模板生成统计

使用SummaryTypeConverter去指定Converter参数对于SummaryItemBase.SummaryType属性

使用DependencyObjectExtensions.DataContext附加属性当你绑定到GridControl统计属性。这个附加的属性同步数据更新束缚属性提高grid性能:
 

<Window.Resources><DataTemplate x:Key="SummaryTemplate"><ContentControl><dxg:GridSummaryItem FieldName="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).FieldName, RelativeSource={RelativeSource Self}}"SummaryType="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).Type, RelativeSource={RelativeSource Self}, Converter={StaticResource SummaryTypeConverter}}"/></ContentControl></DataTemplate>
</Window.Resources>

在GridControl中显示视图模型统计

1、绑定TotalSummarySource和GroupSummarySource属性到总计和分组统计集合

2、设置TotalSummaryGeneratorTemplate和GroupSummaryGeneratorTemplate属性到模板生成统计

3、设置DataViewBase.TotalSummaryPosition属性到Top和Bottom显示Total Summary Panel

<dxg:GridControl ...TotalSummarySource="{Binding TotalSummary}"GroupSummarySource="{Binding GroupSummary}"TotalSummaryGeneratorTemplate="{StaticResource SummaryTemplate}"GroupSummaryGeneratorTemplate="{StaticResource SummaryTemplate}"><dxg:GridControl.View><dxg:TableView TotalSummaryPosition="Bottom"/></dxg:GridControl.View>
</dxg:GridControl>

http://www.zhongyajixie.com/news/25511.html

相关文章:

  • 用源码做自己的网站什么是长尾关键词举例
  • 南京著名网站制作2023能用的磁力搜索引擎
  • 幼儿园管理网站模板长尾关键词挖掘工具
  • 公司网站建设怎么选择广州白云区今天的消息
  • 做网站可以用微软雅黑字体么高手优化网站
  • 网站建设认证试题中国万网官网登录
  • ai网页生成汕头网站建设方案优化
  • 专做项目报告的网站互联网推广话术
  • 怎么做社交网站百度接单平台
  • 女装网站建设的规划书可以推广发广告的app
  • 网页设计与制作期末作业源代码seo中介平台
  • 只有一个页面的网站怎么做郑州seo外包公司哪家好
  • 网站导航设计模板苏州关键词优化排名推广
  • 做学校的网站推广发展前景教育机构网站
  • 给公司做门户网站 可以用凡客吗兰州压热搜
  • 学技术网站推广普通话宣传语100字
  • 自己有域名怎么做免费网站网店推广的作用
  • 相亲网站如何做如何做网络销售产品
  • azure做网站网页界面设计
  • 在网站加上一个模块怎么做无人区在线观看高清1080
  • 网站建设公司招人竞价点击软件工具
  • 烟台做网站联系电话优化公司
  • 高端html5网站建设seo培训网的优点是
  • 深圳网站空间微信营销软件免费版
  • 免费个人网站源码下载百度百度
  • 做汽车保养的网站提高工作效率的方法不正确的是
  • 自己的主机做网站服务器怎么做好seo内容优化
  • 做电子商务网站需要什么软件软文写作经验
  • 如何把自己做的网站广州seo排名优化
  • 怎样做网站吸引人免费网站站长查询