public virtual string GetLayoutFromStringXml() { using (Stream stream = new MemoryStream()) { var optionlayout = new OptionsLayoutGrid(); optionlayout.StoreAppearance = true; MainView.SaveLayoutToStream(stream, optionlayout); stream.Seek(0, System.IO.SeekOrigin.Begin); StreamReader reader = new StreamReader(stream); return(reader.ReadToEnd()); } }
public virtual void LoadLayouFromStringXml(string layoutXml) { byte[] byteArray = Encoding.UTF8.GetBytes(layoutXml); MemoryStream stream = new MemoryStream(byteArray); var optionlayout = new OptionsLayoutGrid(); optionlayout.StoreAppearance = true; MainView.RestoreLayoutFromStream(stream, optionlayout); if (LayoutGrid != null) { LayoutGrid.ColumnPanelRowHeight = LayoutGrid.ColumnPanelRowHeight + 6; } }
public GridForm() { opt = new OptionsLayoutGrid(); opt.Columns.AddNewColumns = true; opt.Columns.RemoveOldColumns = true; opt.Columns.StoreAllOptions = true; opt.Columns.StoreAppearance = true; opt.Columns.StoreLayout = true; opt.StoreAllOptions = true; opt.StoreAppearance = true; opt.StoreFormatRules = true; opt.StoreVisualOptions = true; opt.StoreDataSettings = true; IsOwner = false; }
public virtual void LoadLayouFromStringXml(string layoutXml) { if (string.IsNullOrEmpty(layoutXml)) { this.ResetLayout(); return; } byte[] byteArray = Encoding.UTF8.GetBytes(layoutXml); MemoryStream stream = new MemoryStream(byteArray); var optionlayout = new OptionsLayoutGrid(); optionlayout.StoreAppearance = true; this.RestoreLayoutFromStream(stream, optionlayout); this.ColumnPanelRowHeight = this.ColumnPanelRowHeight + 6; }
public PivotFormWin() { opt = new OptionsLayoutGrid(); opt.Columns.AddNewColumns = true; opt.Columns.RemoveOldColumns = true; opt.Columns.StoreAllOptions = true; opt.Columns.StoreAppearance = true; opt.Columns.StoreLayout = true; opt.StoreAllOptions = true; opt.StoreAppearance = true; opt.StoreFormatRules = true; opt.StoreVisualOptions = true; opt.StoreDataSettings = true; IsOwnwer = false; ParameterDefinition = new List <ParameterDefinition>(); }
OptionsLayoutGrid GetOptionsLayoutGrid() { var optionsLayoutGrid = new OptionsLayoutGrid(); optionsLayoutGrid.Columns.StoreLayout = true; optionsLayoutGrid.Columns.StoreAppearance = false; optionsLayoutGrid.Columns.RemoveOldColumns = false; optionsLayoutGrid.Columns.AddNewColumns = false; optionsLayoutGrid.StoreVisualOptions = false; optionsLayoutGrid.StoreDataSettings = false; optionsLayoutGrid.StoreAppearance = false; optionsLayoutGrid.StoreAllOptions = false; return(optionsLayoutGrid); }
private void SetGridLayout(GridView grid, string layout) { if (string.IsNullOrEmpty(layout)) return; MemoryStream stream = new MemoryStream(); using (StreamWriter wrt = new StreamWriter(stream)) { wrt.Write(layout); wrt.Flush(); stream.Seek(0, SeekOrigin.Begin); OptionsLayoutGrid options = new OptionsLayoutGrid(); options.StoreDataSettings = true; options.StoreAppearance = false; options.StoreVisualOptions = false; grid.RestoreLayoutFromStream(stream, options); } // put the filter text back into the auto-filter-row foreach (GridColumn col in grid.Columns) { string[] parts = (col.FilterInfo.FilterString ?? "").Split('\''); if (parts.Length >= 2) this.gviewRight.SetRowCellValue(GridControl.AutoFilterRowHandle, col, parts[1]); } }
public void SaveLayout(DevExpress.XtraGrid.Views.Grid.GridView view, string gridName) { if (!this.DesignMode) { var regPath = RegUtils.RegBasePath("GridLayout\\" + gridName); var options = new OptionsLayoutGrid(); options.Columns.RemoveOldColumns = true; options.Columns.AddNewColumns = true; options.StoreDataSettings = false; view.SaveLayoutToRegistry(regPath.ToString(), options); } }