private void _InitCell() { if (m_CellList == null) { m_CellList = new Dictionary <Position, CellBase>(); } for (int row = 0; row < m_Securities.Length; row++) { for (int col = 0; col < m_Fields.Length; col++) { if (row == 0 && col == 0) { continue; } CellBase c = null; //Field Header if (row == 0 && col != 0) { c = new CHeaderCell() { Caption = m_Fields[col - 1] }; } //SecurityHeader else if (row != 0 && col == 0) { c = new RHeaderCell() { Caption = m_Securities[row - 1], BackColor = CHeaderCell.HeaderBackColor, DefaultFontColor = CHeaderCell.HeaderFontColor, TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft }; } else { //content c = new TextCell() { Name = m_Securities[row - 1], Tag = m_Fields[col - 1], CellType = TextCell.TextType.String, FontColor = Color.Black, TextAlignment = DevAge.Drawing.ContentAlignment.MiddleRight }; } if (c != null) { m_CellList.Add(new Position(row, col), c); } } } }
private void _ContentCell(string key) { grid1.InvokeIfRequired(() => { //int cnt = m_Channels.Count; //int cnt = m_Channels.Count + 2-1; int cnt = grid1.RowsCount; grid1.Redim(cnt + 1, 5); grid1[cnt, 1] = new RHeaderCell() { BackColor = Color.DimGray, Caption = (cnt - 1).ToString() }.Field; grid1[cnt, 2] = m_Channels[key].Channel.Field; grid1[cnt, 3] = m_Channels[key].Item.Field; grid1[cnt, 4] = m_Channels[key].Value.Field; grid1[cnt, 0] = m_Channels[key].Delay.Field; grid1.AutoSizeCells(); _Sort(); }); }