1.设置最下面的总计行:
gridcontrol.TotalSummary.Add(new GridSummaryItem() {SummaryType=SummaryItemType.Count, FieldName = "SID", DisplayFormat = "总记录数:{0:0}"});
显示效果如下:
参数:
SummaryItemType:聚合类型:Devexpress已经具备常用的方法了,基本够用,实在不够用可以使用Custom;
FieldName:统计列名;
DisplayFormat:显示格式;
2.隐藏分组的Panel:
tableView1.ShowGroupPanel = false;
3.设置当前焦点单元格为编辑状态(光标移入):
tableView1.ShowEditor();
此方法写入OnLoad无效,写入Loaded有效。
4.Devexpress汉化方法:
1.引用汉化DLL文件:DevExpress.LocalizationWPF.v11.2.dll
2.加入如下代码:
DevExpress.Xpf.Core.DXMessageBoxLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfCoreDXMessageBoxLocalizationCHS(); DevExpress.Xpf.Core.Localization.TabControlLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfCoreLocalizationCHS(); EditorLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfEditorsLocalizationCHS(); DevExpress.Xpf.Docking.Base.DockingLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfDockingLocalizationCHS(); GridControlLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfGridLocalizationCHS(); DevExpress.Xpf.Printing.PrintingLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfPrintingLocalizationCHS(); DevExpress.Xpf.Ribbon.RibbonControlLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfRibbonLocalizationCHS(); DevExpress.Xpf.RichEdit.Localization.XpfRichEditLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXpfRichEditLocalizationCHS(); DevExpress.XtraRichEdit.Localization.XtraRichEditLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraRichEditLocalizationCHS();
持续更新!