devgridContral

  #region 加载gridControl布局项
        /// <summary>
        /// 加载gridControl布局项
        /// </summary>
        private void LoadLayoutFile()
        {
            string strLayOutFilePath = GdkyConstant.RootDirectory + "config\\Layout\\conInstLayout.xml";
            if (File.Exists(strLayOutFilePath))
            {
                grdConData.ForceInitialize();
                OptionsLayoutBase optionLayout = new OptionsLayoutBase();
                grdConData.MainView.RestoreLayoutFromXml(strLayOutFilePath, optionLayout);
            }
        }

 

   #region 保存gridControl布局项
        /// <summary>
        /// 保存gridControl布局项
        /// </summary>
        private void SaveLayoutFile()
        {
            string strLayOutTmp = GdkyConstant.RootDirectory + "config\\Layout";
            if (!Directory.Exists(strLayOutTmp))
            {
                Directory.CreateDirectory(strLayOutTmp);
            }
            string strLayOutFilePath = string.Format("{0}\\{1}.xml", strLayOutTmp, "conInstLayout");
            OptionsLayoutBase optionLayout = new OptionsLayoutBase();
            grdConData.MainView.SaveLayoutToXml(strLayOutFilePath, optionLayout);
        }
        #endregion

           

           /////----获取配置文件

           string strLayOutTmp =Environment.CurrentDirectory+ "config\\Layout";
            if (!File.Exists(strLayOutTmp))
            {
                Directory.CreateDirectory(strLayOutTmp);
            }
            string strLayOutFilePath = string.Format("{0}\\{1}.xml", strLayOutTmp, "MsInstLayout");
        

            DataTable dt = new DataTable();
            dt = this.testDataSet1.Table_1;
            if (dt.Rows.Count > 0)
            {
            string xmlContent=dt.Rows[0][0].ToString();
            CreatXmlToSave(xmlContent, strLayOutFilePath);
            }

            ////---

posted @ 2018-04-19 10:12  laolv  阅读(185)  评论(0编辑  收藏  举报