Esempio n. 1
0
        private void GridRowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            int realIndex = _rowManager.RealIndex(e.RowIndex);

            if (FeatureSet.FeatureSelected(realIndex))
            {
                var r     = new Rectangle(e.RowBounds.Left, e.RowBounds.Top, RowHeadersWidth, e.RowBounds.Height);
                var brush = new SolidBrush(Color.FromArgb(64, _selectionColor));
                e.Graphics.FillRectangle(brush, r);
            }
        }
Esempio n. 2
0
        private void GridRowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            var rowBounds = new Rectangle(
                RowHeadersWidth,
                e.RowBounds.Top,
                Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - HorizontalScrollingOffset + 1,
                e.RowBounds.Height);

            int realIndex = _rowManager.RealIndex(e.RowIndex);

            if (FeatureSet.FeatureSelected(realIndex))
            {
                e.PaintParts &= ~DataGridViewPaintParts.Background;
                e.PaintHeader(false);
                e.Graphics.FillRectangle(new SolidBrush(_selectionColor), rowBounds);
            }
        }