当前位置: 首页>>代码示例>>C#>>正文


C# DevExpress.SaveLayoutToXml方法代码示例

本文整理汇总了C#中DevExpress.SaveLayoutToXml方法的典型用法代码示例。如果您正苦于以下问题:C# DevExpress.SaveLayoutToXml方法的具体用法?C# DevExpress.SaveLayoutToXml怎么用?C# DevExpress.SaveLayoutToXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DevExpress的用法示例。


在下文中一共展示了DevExpress.SaveLayoutToXml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveLayout

        public static void SaveLayout(DevExpress.XtraGrid.Views.Grid.GridView ListView, string PageName, string frmName)
        {
            try
            {
                DevExpress.Utils.OptionsLayoutGrid opt = new DevExpress.Utils.OptionsLayoutGrid();
                opt.StoreAllOptions = false;
                opt.Columns.StoreAllOptions = true;
                opt.Columns.StoreLayout = true;
                opt.Columns.StoreAppearance = true;
                opt.StoreVisualOptions = true;
                opt.StoreDataSettings = false;
                ListView.OptionsLayout.Assign(opt);
                ListView.SaveLayoutToXml(Common.GetSolutionPath(Application.StartupPath) + @"GridLayout\" 
                    + Application.ProductName + "."
                    + frmName + "."
                    + PageName + "."
                    + ListView.GridControl.Name + "." + ListView.Name + ".xml");

            }
            catch (Exception ex)
            {
                //TODO::sysParameter.MessageInf
                XtraMsgBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
开发者ID:xlgwr,项目名称:producting,代码行数:26,代码来源:formlayout.cs

示例2: SaveLayout

 /******************************8
 /// <summary>
 /// �Դ���Form������+"_"+EFDevLayoutControl������,�Լ�Ĭ������ģʽ[�ݶ��û���]����grid����
 /// </summary>
 public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl)
 {
     SaveLayout(layoutControl, ConfigEnum.Default);
 }
 /// <summary>
 /// �Դ���Form������+"_"+gridView������,�Լ��ƶ�������ģʽ����grid����
 /// </summary>
 /// <param name="ConfigModule">�û�������Ŀ��</param>
 public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule)
 {
     this.SaveLayout(layoutControl, ConfigModule, string.Empty, string.Empty);
 }
 ******************************/
 /// <summary>
 ///  �ļ�Ŀ¼�������򴴽�,XML��������Ϊ: className +"��������_"+EFDevLayoutControl������.XML. 
 ///  ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML
 /// </summary>  
 /// <param name="ConfigModule">����Ĭ��,�û�������Ŀ��</param>
 /// <param name="className">����,�����������û���ʱ,Ϊ�����ֲ�ͬ������������ </param>   
 /// <param name="moduleName">һ��ģ������(��DE,Ϊ��ʱȡ�������Ƶĵ�4��6λ)</param>
 public void SaveLayout(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);
     if (ConfigModule == ConfigEnum.UserConfig)
     {
         //λ��UserConfig��,�û����ļ�����,һ��ģ����
         fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\";
     }
     else if (ConfigModule == ConfigEnum.EPConfig)
     {
         //λ��һ��ģ����
         fileDirectory = fileDirectory + "\\..\\" + moduleName + "\\";
     }
     else
     {
         //λ��UserConfig��,�û����ļ�����,һ��ģ���� (Ĭ���û�����)
         fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\";
     }
     string fileDirectory2 = "";
     try
     {
         fileDirectory2 = fileDirectory + "EC.UserConfig.Instance.Culture" + "\\";
     }
     catch { }
     //�ļ�Ŀ¼�������򴴽�[�߼���,������Ŀ����ʱ,ģ��Ŀ¼һ������,���򱨴�]
     if (!System.IO.Directory.Exists(fileDirectory))
     {
         System.IO.Directory.CreateDirectory(fileDirectory);
     }
     if (fileDirectory2 != "" && !System.IO.Directory.Exists(fileDirectory2))
     {
         System.IO.Directory.CreateDirectory(fileDirectory2);
     }
     //�����ļ���
     //string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml";
     //  ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML
     string fileName = formName + "_" + layoutControl.Name +(className.Trim().Equals("")?"":("_"+className.Trim()))+ ".xml";
     string filePath = fileDirectory + fileName;
     string filePath2 = fileDirectory2 + fileName;
     bool isFirstConfig = false;
     if (System.IO.File.Exists(filePath))
     {
         if (System.IO.File.Exists(filePath2))
         {
             //�ļ��Ѵ���,����ʾ,�Ƿ񸲸�
             if (EF.EFMessageBox.Show("�����ļ��Ѵ���,�Ƿ��滻��","��ʾ", MessageBoxButtons.YesNo) != DialogResult.Yes)
             {
                 return;
             }
         }
     }
     else
     {
         isFirstConfig = false;
     }
     if (isFirstConfig)
     {
         //��ʹ�ǵ�һ������Ҳ�����浽Ĭ��Ŀ¼��.ֻ�ŵ���Ӧ����Ŀ¼��
        // layoutControl.SaveLayoutToXml(filePath);
     }
     layoutControl.SaveLayoutToXml(filePath2);
 }
开发者ID:sunpander,项目名称:VSDT,代码行数:98,代码来源:Utility.cs

示例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");
        }
开发者ID:DaoManhTuan,项目名称:DoAn1,代码行数:17,代码来源:User.cs


注:本文中的DevExpress.SaveLayoutToXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。