DevExpress控件常用代码
来源:互联网 发布:淘宝安全中心首页网页 编辑:程序博客网 时间:2024/05/16 11:41
1.加载和保存 GridControl 控件布局
string fileName =Path.Combine(Application.UserAppDataPath, "XtraGrid_SaveLayoutToXML美发员工业绩.xml"); private void EmployeePerformanceTotalForm_Load(object sender, EventArgs e) { gridControl1.ForceInitialize(); // Restore the previously saved layout if (System.IO.File.Exists(fileName)) gridControl1.MainView.RestoreLayoutFromXml(fileName);}
private void EmployeePerformanceTotalForm_FormClosing(object sender, FormClosingEventArgs e) { // Save the layout to an XML file gridControl1.MainView.SaveLayoutToXml(fileName); }
2.DevExpress Gridcontrol Print
Gridcontrol Print 有两种方法来实现:
一:使用GridControl 自带的ShowPrintPreview方法。
this.gridControl1.ShowPrintPreview();
方法一只是单纯的把gridcontrol1中gridview给打印出来。如果想要设置标题之类的,则需要用方法二来实现。
二:使用PrintingSystem控件。在link Collection中Add PrintableComponentLink。PrintableComponentLink有属性PaperKind(纸张类型)、Landscape(横纵向打印)。
Component的属性为需要打印的控件。打印时要显示标题可以通过PrintableComponentLink的CreateReportHeaderArea来实现
private void printableComponentLink1_CreateReportHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e) { string reportHeader = "产品基本资料档"; e.Graph.StringFormat = new BrickStringFormat(StringAlignment.Center); e.Graph.Font = new Font("Tahoma", 14, FontStyle.Bold); RectangleF rec = new RectangleF(0, 0, e.Graph.ClientPageSize.Width, 50); e.Graph.DrawString(reportHeader, Color.Black, rec, BorderSide.None); } // 打印: this.printableComponentLink1.CreateDocument(); this.printableComponentLink1.ShowPreview();
0 0
- DevExpress控件常用代码
- DevExpress XtraGrid网格控件常用示例汇总(含代码)
- DevExPress控件 客户端常用方法
- Devexpress TextEditor等控件常用操作
- DevExpress控件
- DevExpress控件之GridControl控件(代码篇)
- DevExpress控件开发常用要点(项目总结版)
- DevExpress控件GridControl开发常用要点(项目总结版)
- DevExpress 第三方控件汉化的全部代码和使用方法
- DevExpress 第三方控件汉化的全部代码和使用方法
- DevExpress 第三方控件汉化的全部代码 和使用方法
- DevExpress第三方控件汉化的全部代码和使用方法
- DevExpress 第三方控件汉化的全部代码和使用方法
- 使用DevExpress的TreeList控件的效果和实现代码
- DevExpress控件 在 winform 上的一些控件的常用属性设置
- devExpress控件:对常用的控件作必要输入性check的公共函数
- DevExpress控件汉化
- DevExpress控件之gridControl
- Unity下载网络资源到本地,再从本地调用
- oracle10g安装过程报ins_emdb.mk错误处理方法
- java线程同步锁优化--底层虚拟机
- 3.3 Git 分支 - 分支的管理
- 2014系统架构师大会随感--第三天
- DevExpress控件常用代码
- SICP 习题 (2.1) 解题总结:用复合数据表示有理数
- 磁盘调度算法
- iOS视图传值的3种方法.
- 3.4 Git 分支 - 利用分支进行开发的工作流程
- WPS 使用技巧
- Java的六种存储类型
- SICP 习题 (2.2) 解题总结:用复合数据表示点和线段
- 两个线程交替打印ABABAB