protected internal CellElement(CellView host, object row, Column column) : base(host) { m_Row = row; m_Column = column; m_Grid = column.Grid; m_Style = new Style(null, getBaseStyle()); if (row == null) //if header cell { m_ColumnResizeElement = new ColumnResizeElement(host, this); m_ColumnResizeElement.ZOrder = 1; } }
public Grid() : base() { //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //the CellView is already dbl buffered SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); //no ERASE BACKGROUND SetStyle(ControlStyles.UserMouse, true); base.DoubleBuffered = true; UpdateStyles(); m_ForeBrush = new SolidBrush(ForeColor); m_Style = new Style(this, null); m_HeaderStyle = new Style(this, null); m_SelectedStyle = new Style(this, null); BuildDefaultStyle(m_Style); BuildDefaultHeaderStyle(m_HeaderStyle); BuildDefaultSelectedStyle(m_SelectedStyle); ColumnHidingAllowed = true; m_CellView = new CellView() { Parent = this, TabStop = false }; m_CellView.MouseClick += (_, e) => this.OnMouseClick(e); m_CellView.MouseDoubleClick += (_, e) => this.OnMouseDoubleClick(e); m_CellView.MouseDown += (_, e) => this.OnMouseDown(e); m_CellView.MouseUp += (_, e) => this.OnMouseUp(e); m_CellView.MouseEnter += (_, e) => this.OnMouseEnter(e); m_CellView.MouseLeave += (_, e) => this.OnMouseLeave(e); m_CellView.MouseHover += (_, e) => this.OnMouseHover(e); m_CellView.MouseMove += (_, e) => this.OnMouseMove(e); m_CellView.Click += (_, e) => this.OnClick(e); m_HScrollBar = new HScrollBar() { Parent = this, TabStop = false, Minimum = 0, SmallChange = 1, LargeChange = 1 }; m_HScrollBar.ValueChanged += m_HScrollBar_Scroll; m_VScrollBar = new VScrollBar() { Parent = this, TabStop = false, Minimum = 0, SmallChange = 1 }; m_VScrollBar.ValueChanged += m_VScrollBar_Scroll; m_DataSourceChangedNotificationTimer = new Timer(); m_DataSourceChangedNotificationTimer.Interval = REBUILD_TIMEOUT_MS; m_DataSourceChangedNotificationTimer.Enabled = false; m_DataSourceChangedNotificationTimer.Tick += new EventHandler((o, e) => { if (m_RepositioningColumn != null || m_ResizingColumn != null) { return; //while grid is being manipulated dont flush timer just yet } m_DataSourceChangedNotificationTimer.Stop(); notifyDataSourceChanged(m_DataSourceChangedNotificationRow); m_DataSourceChangedNotificationRow = null; }); }
internal CommentElement(CellView host) : base(host) { }
internal ColumnResizeElement(CellView host, CellElement headerCell) : base(host) { m_HeaderCell = headerCell; m_Grid = m_HeaderCell.Column.Grid; }