本文整理汇总了C#中DevExpress.RestoreLayoutFromXml方法的典型用法代码示例。如果您正苦于以下问题:C# DevExpress.RestoreLayoutFromXml方法的具体用法?C# DevExpress.RestoreLayoutFromXml怎么用?C# DevExpress.RestoreLayoutFromXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevExpress
的用法示例。
在下文中一共展示了DevExpress.RestoreLayoutFromXml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReStoreLayOut
public static void ReStoreLayOut(DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView ListView)
{
if (System.IO.File.Exists(Common.GetSolutionPath(Application.StartupPath) + @"GridLayout\" + Application.ProductName + "." + ListView.GridControl.FindForm ().Name + "." + ListView.GridControl.Name + "." + ListView.Name + ".xml"))
ListView.RestoreLayoutFromXml(Common.GetSolutionPath(Application.StartupPath) + @"GridLayout\" + Application.ProductName + "." + ListView.GridControl.FindForm ().Name + "." + ListView.GridControl.Name + "." + ListView.Name + ".xml");
}
示例2: LoadLayout
/// <summary>
/// Ѱ��(��className+����Form������+"_"+EFDevLayoutControl������)�������ļ�.���ز���..���ݲ���(����ģʽ)ѡ���ӦĿ¼�µ������ļ�.
/// </summary>
/// <param name="ConfigModule">����ģʽ,Ĭ��ʱ�Ȳ����û�����,�ٲ�����Ŀ������..</param>
/// <param name="className">������[����������_+EFDevLayoutControl���Ʋ�������Ψһxml�ļ�������ʱ,�ڿ�ͷ���������</param>
/// <param name="moduleName">һ��ģ������.��DE,FI��</param>
public void LoadLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule, string className, string moduleName)
{
//ģ������
string formName = layoutControl.FindForm().Name;
if (moduleName.Trim().Equals(""))
{
moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName;
}
if (formName.StartsWith("Form"))
{
formName = formName.Substring(4);
}
//XML·��
string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location;
fileDirectory = Path.GetDirectoryName(fileDirectory);
string fileDirectoryUser = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\";
string fileDirectoryEP = fileDirectory + "\\..\\" + moduleName + "\\";
//�Ȳ鿴�û�������,Ŀ¼�����ڶ�ȡ��Ŀ����
// ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML
string fileName = formName + "_" + layoutControl.Name + (className.Trim().Equals("") ? "" : ("_" + className.Trim())) + ".xml";
//string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml";
string filePath = "";
if (ConfigModule == ConfigEnum.EPConfig)
{
filePath = fileDirectoryEP + fileName;
}
else if (ConfigModule == ConfigEnum.UserConfig)
{
filePath = fileDirectoryUser + fileName;
}
else //Ĭ������.�ȶ�ȡ�û�������,���������ȡ��Ŀ������
{
filePath = fileDirectoryUser + fileName;
if (! IsFileExit(ref filePath))//������,���ȡ��Ŀ����
{
filePath = fileDirectoryEP + fileName;
}
}
if (IsFileExit(ref filePath)) // (System.IO.File.Exists(filePath)) //����,���ȡ
{
//string EPConfigXML = fileDirectoryEP + fileName; //��Ŀ������xml
//��Ŀ������xml ������ھ��鷳��---������,��ֱ�Ӷ�ȡ�����ļ�
//---�ȼ�����Ŀ������,�Ѳ��ɼ�����,����Ϊ��������
//---������û������� "�ټ����û�������",�����˳�
//---�ٰѲ�����������Ϊ���ɼ�
//if (System.IO.File.Exists(EPConfigXML))
//{
// layoutControl.RestoreLayoutFromXml(EPConfigXML);
// if (view is DevExpress.XtraGrid.Views.Grid.GridView)
// {
// foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns)
// {
// gridCol.OptionsColumn.ShowInCustomizationForm = gridCol.Visible;
// }
// }
// //Ȼ������û�������
// if (filePath.Equals(EPConfigXML))
// {
// break;
// }
// view.RestoreLayoutFromXml(filePath);
// //Ȼ���ٴμ��,����Ŀ�����ɼ���,Ҳ��Ϊ���ɼ�
// if (view is DevExpress.XtraGrid.Views.Grid.GridView)
// {
// foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns)
// {
// gridCol.Visible = gridCol.OptionsColumn.ShowInCustomizationForm;
// }
// }
//}
//else
//{
// view.RestoreLayoutFromXml(filePath);
//}
layoutControl.RestoreLayoutFromXml(filePath);
// return true;
}
else
{
// return false;
}
}
示例3: xuat_excel
/// <summary>
/// hàm này cho phép xuất excel và lưu dữ liệu trong Release
/// </summary>
/// <param name="v_grv"> tên của gridview</param>
/// <param name="name"> tên file mà bạn muốn xuất ra</param>
public static void xuat_excel(DevExpress.XtraGrid.Views.Grid.GridView v_grv, string name)
{
name =name+ ".xls";
v_grv.SaveLayoutToXml("tempLayout.xml");
foreach (DevExpress.XtraGrid.Columns.GridColumn col in v_grv.Columns)
{
col.Visible = true;
}
v_grv.ExportToXls(name);
v_grv.RestoreLayoutFromXml("tempLayout.xml");
}