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_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; }); }
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; } }
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_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); m_CellView = new CellView() { Parent = this , TabStop = false}; 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 ColumnResizeElement(CellView host, CellElement headerCell) : base(host) { m_HeaderCell = headerCell; m_Grid = m_HeaderCell.Column.Grid; }
internal CommentElement(CellView host) : base(host) { }
internal CommentElement(CellView host) : base(host) { }
internal ColumnResizeElement(CellView host, CellElement headerCell) : base(host) { m_HeaderCell = headerCell; m_Grid = m_HeaderCell.Column.Grid; }