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


C# GridView.RestoreLayoutFromXml方法代码示例

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


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

示例1: LoadLayout

 internal static void LoadLayout(GridView view, string name)
 {
     try
     {
         view.RestoreLayoutFromXml(GetLayoutPath() + Path.DirectorySeparatorChar + name);
     }
     catch (Exception err)
     {
         MessageBox.Show("Load Layout Failed", "Failed to load the layout");
     }
 }
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:11,代码来源:CodeIssueOptions.cs

示例2: CustomizeView

 public void CustomizeView(GridView gridView)
 {
     GPGDataGrid gridControl = gridView.GridControl as GPGDataGrid;
     try
     {
         string path = Application.StartupPath + @"\grids\" + gridView.Name + ".xml";
         if (File.Exists(path))
         {
             gridView.RestoreLayoutFromXml(path);
         }
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
     gridView.Layout += new EventHandler(this.gridView_Layout);
     if (!gridControl.CustomizeStyle)
     {
         gridView.Appearance.Reset();
         gridView.OptionsView.EnableAppearanceEvenRow = true;
         gridView.OptionsView.EnableAppearanceOddRow = true;
         gridView.OptionsView.RowAutoHeight = true;
         gridView.OptionsView.ShowVertLines = false;
         gridView.OptionsView.ShowHorzLines = false;
         gridView.OptionsView.ShowIndicator = false;
         gridView.OptionsCustomization.AllowRowSizing = false;
         gridView.PaintStyleName = "Web";
         gridView.OptionsSelection.EnableAppearanceFocusedCell = false;
         gridView.FocusRectStyle = DrawFocusRectStyle.None;
         foreach (AppearanceObject obj2 in gridView.Appearance)
         {
             this.SetAppearance(obj2, Program.Settings.Appearance.Text.MasterFont, Color.Black, Color.Black, Color.White);
         }
         this.SetAppearance(gridView.Appearance.HeaderPanel, new Font(this.MasterFont, FontStyle.Bold), Color.FromArgb(0xa4, 0xa4, 0xa4), Color.Black, Color.White);
         gridView.Appearance.HeaderPanel.GradientMode = LinearGradientMode.Vertical;
         this.SetAppearance(gridView.Appearance.GroupPanel, Color.Black, Color.Black, Color.White);
         this.SetAppearance(gridView.Appearance.ColumnFilterButton, Color.Black, Color.Black, Color.White);
         if (gridControl.LevelTree.HasChildren && (gridView.DetailLevel == 0))
         {
             Font font = new Font(Program.Settings.Appearance.Text.MasterFont, FontStyle.Bold);
             this.SetAppearance(gridView.Appearance.EvenRow, font, Color.FromArgb(0x51, 0x56, 0x87), Color.FromArgb(0x38, 0x3d, 0x67), Color.White);
             gridView.Appearance.EvenRow.GradientMode = LinearGradientMode.Vertical;
             this.SetAppearance(gridView.Appearance.OddRow, font, Color.FromArgb(0x51, 0x56, 0x87), Color.FromArgb(0x38, 0x3d, 0x67), Color.White);
             gridView.Appearance.OddRow.GradientMode = LinearGradientMode.Vertical;
             this.SetAppearance(gridView.Appearance.HideSelectionRow, font, Color.FromArgb(0x51, 0x56, 0x87), Color.FromArgb(0x38, 0x3d, 0x67), Color.White);
             gridView.Appearance.HideSelectionRow.GradientMode = LinearGradientMode.Vertical;
             this.SetAppearance(gridView.Appearance.SelectedRow, font, Color.FromArgb(0x51, 0x56, 0x87), Color.FromArgb(0x38, 0x3d, 0x67), Color.Black);
             gridView.Appearance.SelectedRow.GradientMode = LinearGradientMode.Vertical;
             this.SetAppearance(gridView.Appearance.FocusedRow, font, Color.FromArgb(0x51, 0x56, 0x87), Color.FromArgb(0x38, 0x3d, 0x67), Color.Black);
             gridView.Appearance.FocusedRow.GradientMode = LinearGradientMode.Vertical;
         }
         else if (gridView.DetailLevel >= 1)
         {
             this.SetAppearance(gridView.Appearance.SelectedRow, Color.FromArgb(0x40, 0x40, 0x40), Color.Black, Color.White);
             this.SetAppearance(gridView.Appearance.FocusedRow, Color.FromArgb(0x40, 0x40, 0x40), Color.Black, Color.White);
         }
         else
         {
             this.SetAppearance(gridView.Appearance.EvenRow, Color.FromArgb(0x40, 0x40, 0x40), Color.Black, Color.White);
             this.SetAppearance(gridView.Appearance.OddRow, Color.Black, Color.Black, Color.White);
             this.SetAppearance(gridView.Appearance.Row, Color.Black, Color.Black, Color.White);
             this.SetAppearance(gridView.Appearance.HideSelectionRow, Color.FromArgb(0xc0, 0xc0, 0xff), Color.FromArgb(0x40, 0x40, 80), Color.White);
             this.SetAppearance(gridView.Appearance.SelectedRow, Color.FromArgb(0xc0, 0xc0, 0xff), Color.FromArgb(0x40, 0x40, 80), Color.Black);
             this.SetAppearance(gridView.Appearance.FocusedRow, Color.FromArgb(0xc0, 0xc0, 0xff), Color.FromArgb(0x40, 0x40, 80), Color.Black);
             this.SetAppearance(gridView.Appearance.Preview, Color.Black, Color.Black, Color.Gray);
         }
         gridView.Appearance.Empty.BackColor = Color.Transparent;
     }
 }
开发者ID:micheljung,项目名称:gpgnetfix,代码行数:69,代码来源:StylePrefs.cs


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