本文整理汇总了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");
}
}
示例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;
}
}