DevExpress gridControl 布局(Layout)保存与读取----1

DevExpress GridControl控件提供了自定义布局的功能,可以随意更改其布局,并保存。布局的保存有三种形式:注册表(Registry);XML文件(Xml) ;流(Stream)。
关于注册表保存,DevExpress 提供了SaveLayoutToRegistry方法来保存自定义布局到注册表中,当需要是使用RestoreLayoutFromRegistry方法读取所保存的布局并应用。
下面是的例子是将布局保存到注册表中:
string regKey = "DevExpress\\XtraGrid\\Layouts\\MainLayout"; gridControl1.MainView.SaveLayoutToRegistry(regKey);//保存布局 //...
gridControl1.MainView.RestoreLayoutFromRegistry(regKey);//读取(还原)布局
这应该是最简单的吧!
Tags: 

延伸阅读

最新评论

发表评论