public static DataGridView GetDataGridServers() { DataGridView newGrid = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None); DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = newGrid.DefaultCellStyle; DataGridViewColumn colum0 = new DataGridViewColumn(); colum0.CellTemplate = cell0; colum0.HeaderText = OsLocalization.Entity.ColumnServers1; colum0.ReadOnly = true; colum0.Width = 150; newGrid.Columns.Add(colum0); DataGridViewColumn colu = new DataGridViewColumn(); colu.CellTemplate = cell0; colu.HeaderText = OsLocalization.Entity.ColumnServers2; colu.ReadOnly = true; colu.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; newGrid.Columns.Add(colu); return(newGrid); }
private void CreateTable() { _grid = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None); DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = _grid.DefaultCellStyle; DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = OsLocalization.Entity.ParametersColumn1; column0.ReadOnly = true; column0.Width = 250; _grid.Columns.Add(column0); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell0; column1.HeaderText = OsLocalization.Entity.ParametersColumn2; column1.ReadOnly = false; column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _grid.Columns.Add(column1); _grid.Rows.Add(null, null); _grid.CellValueChanged += _grid_CellValueChanged; HostParametrs.Child = _grid; }
public static DataGridView GetDataGridProxies() { DataGridView newGrid = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders); DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = newGrid.DefaultCellStyle; DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = OsLocalization.Entity.ProxiesColumn1; column0.ReadOnly = true; column0.Width = 170; newGrid.Columns.Add(column0); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell0; column1.HeaderText = OsLocalization.Entity.ProxiesColumn2; column1.ReadOnly = true; column1.Width = 100; newGrid.Columns.Add(column1); DataGridViewColumn column = new DataGridViewColumn(); column.CellTemplate = cell0; column.HeaderText = OsLocalization.Entity.ProxiesColumn3; column.ReadOnly = true; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; newGrid.Columns.Add(column); return(newGrid); }
public static DataGridView GetDataGridDataSource() { DataGridView myGridView = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None); DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = myGridView.DefaultCellStyle; DataGridViewColumn column2 = new DataGridViewColumn(); column2.CellTemplate = cell0; column2.HeaderText = OsLocalization.Entity.ColumnDataSource1; column2.ReadOnly = true; column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column2); DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = OsLocalization.Entity.ColumnDataSource2; column0.ReadOnly = true; column0.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column0); DataGridViewColumn column = new DataGridViewColumn(); column.CellTemplate = cell0; column.HeaderText = OsLocalization.Entity.ColumnDataSource3; column.ReadOnly = false; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell0; column1.HeaderText = OsLocalization.Entity.ColumnDataSource4; column1.ReadOnly = true; column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column1); DataGridViewColumn column3 = new DataGridViewColumn(); column3.CellTemplate = cell0; column3.HeaderText = OsLocalization.Entity.ColumnDataSource5; column3.ReadOnly = true; column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column3); DataGridViewColumn column4 = new DataGridViewColumn(); column4.CellTemplate = cell0; column4.HeaderText = OsLocalization.Entity.ColumnDataSource6; column4.ReadOnly = true; column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; myGridView.Columns.Add(column4); return(myGridView); }
public static DataGridView GetDataGridPortfolios() { DataGridView _gridPosition = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None); DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = _gridPosition.DefaultCellStyle; DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = OsLocalization.Entity.ColumnPortfolio1; column0.ReadOnly = true; column0.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column0); DataGridViewColumn column = new DataGridViewColumn(); column.CellTemplate = cell0; column.HeaderText = OsLocalization.Entity.ColumnPortfolio2; column.ReadOnly = true; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell0; column1.HeaderText = OsLocalization.Entity.ColumnPortfolio3; column1.ReadOnly = true; column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column1); DataGridViewColumn column3 = new DataGridViewColumn(); column3.CellTemplate = cell0; column3.HeaderText = OsLocalization.Entity.ColumnPortfolio4; column3.ReadOnly = true; column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column3); DataGridViewColumn column4 = new DataGridViewColumn(); column4.CellTemplate = cell0; column4.HeaderText = OsLocalization.Entity.ColumnPortfolio5; column4.ReadOnly = true; column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column4); DataGridViewColumn column5 = new DataGridViewColumn(); column5.CellTemplate = cell0; column5.HeaderText = OsLocalization.Entity.ColumnPortfolio6; column5.ReadOnly = true; column5.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column5); DataGridViewColumn column6 = new DataGridViewColumn(); column6.CellTemplate = cell0; column6.HeaderText = OsLocalization.Entity.ColumnPortfolio7; column6.ReadOnly = true; column6.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column6); DataGridViewColumn column7 = new DataGridViewColumn(); column7.CellTemplate = cell0; column7.HeaderText = OsLocalization.Entity.ColumnPortfolio8; column7.ReadOnly = true; column7.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _gridPosition.Columns.Add(column7); return(_gridPosition); }
/// <summary> /// Load controls into the connector /// загрузить контролы в коннектор /// </summary> public void CreateGlass() { try { _glassBox = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None); _glassBox.AllowUserToResizeRows = false; _glassBox.SelectionChanged += _glassBox_SelectionChanged; DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = _glassBox.DefaultCellStyle; DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = OsLocalization.Entity.ColumnMarketDepth1; column0.ReadOnly = true; column0.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _glassBox.Columns.Add(column0); DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); DataGridViewColumn column = new DataGridViewColumn(); column.CellTemplate = cell; column.HeaderText = OsLocalization.Entity.ColumnMarketDepth3; column.ReadOnly = true; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _glassBox.Columns.Add(column); DataGridViewTextBoxCell cell2 = new DataGridViewTextBoxCell(); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell2; column1.HeaderText = OsLocalization.Entity.ColumnMarketDepth2; column1.ReadOnly = true; column1.Width = 90; _glassBox.Columns.Add(column1); DataGridViewTextBoxCell cell3 = new DataGridViewTextBoxCell(); DataGridViewColumn column3 = new DataGridViewColumn(); column3.CellTemplate = cell3; column3.HeaderText = OsLocalization.Entity.ColumnMarketDepth3; column3.ReadOnly = true; column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _glassBox.Columns.Add(column3); DataGridViewCellStyle styleRed = new DataGridViewCellStyle(); styleRed.Alignment = DataGridViewContentAlignment.MiddleRight; styleRed.ForeColor = Color.FromArgb(254, 84, 0); styleRed.Font = new Font("Areal", 3); for (int i = 0; i < 25; i++) { _glassBox.Rows.Add(null, null, null); _glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.BackColor = Color.FromArgb(28, 33, 37); _glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.ForeColor = Color.FromArgb(254, 84, 0); _glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.Font = new Font("New Times Roman", 10); _glassBox.Rows[_glassBox.Rows.Count - 1].Cells[0].Style = styleRed; _glassBox.Rows[_glassBox.Rows.Count - 1].Cells[1].Style = styleRed; } DataGridViewCellStyle styleBlue = new DataGridViewCellStyle(); styleBlue.Alignment = DataGridViewContentAlignment.MiddleRight; styleBlue.ForeColor = Color.FromArgb(57, 157, 54); styleBlue.Font = new Font("Areal", 3); for (int i = 0; i < 25; i++) { _glassBox.Rows.Add(null, null, null); //_glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.BackColor = Color.Black; _glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.ForeColor = Color.FromArgb(57, 157, 54); _glassBox.Rows[_glassBox.Rows.Count - 1].DefaultCellStyle.Font = new Font("New Times Roman", 10); _glassBox.Rows[_glassBox.Rows.Count - 1].Cells[0].Style = styleBlue; _glassBox.Rows[_glassBox.Rows.Count - 1].Cells[1].Style = styleBlue; } _glassBox.Rows[22].Cells[0].Selected = true; _glassBox.Rows[22].Cells[0].Selected = false; } catch (Exception error) { SendNewLogMessage(error.ToString(), LogMessageType.Error); } }