public override void PaintRow(TableChildRendererBase tableChildRenderer, TablePaintRowArgs ea, bool isRowMarked, bool isSelected, ColumnsManager columnsManager) { Region orgRegion = ea.Graphics.Clip; for (int i = ea.CellsData.Count - 1; i >= 0; i--) { PaintCellBackground(tableChildRenderer, ea.CellsData[i], ea.Graphics, ea.Item, isRowMarked, isSelected, columnsManager); PaintCellControls(tableChildRenderer, ea.Item, ea.Graphics, ea.CellsData[i], columnsManager, isRowMarked, isSelected); } ea.Graphics.Clip = orgRegion; }
/// <summary> /// Paint table controls for row /// </summary> /// <param name="tableRenderer"></param> /// <param name="g"></param> /// <param name="item"></param> /// <param name="isRowMarked"></param> /// <param name="isSelected"></param> /// <param name="columnsManager"></param> private void PaintRowControls(TableChildRendererBase tableChildRenderer, Graphics g, TableItem item, bool isRowMarked, bool isSelected, ColumnsManager columnsManager) { if (item != null) { item.ZOrderSortedControls = item.ZOrderSortedControls != null && item.ZOrderSortedControls.Count > 0 ? item.ZOrderSortedControls : item.GetAllColumnsControlsByZOrder(); if (item.ZOrderSortedControls != null) { foreach (PlacementDrivenLogicalControl lg in item.ZOrderSortedControls) { tableChildRenderer.PaintControl(lg, tableChildRenderer.GetCellRect(lg), g, isRowMarked, isSelected, columnsManager); } } } }
public override void PaintRow(TableChildRendererBase tableChildRenderer, TablePaintRowArgs ea, bool isRowMarked, bool isSelected, ColumnsManager columnsManager) { Region orgRegion = ea.Graphics.Clip; Region tableRegion = tableControl.isHscrollShown() ? orgRegion : GetTableColumnsRegion(); for (int i = ea.CellsData.Count - 1; i >= 0; i--) { PaintCellBackground(tableChildRenderer, ea.CellsData[i], ea.Graphics, ea.Item, isRowMarked, isSelected, columnsManager); } ea.Graphics.Clip = tableRegion; PaintRowControls(tableChildRenderer, ea.Graphics, ea.Item, isRowMarked, isSelected, columnsManager); ea.Graphics.Clip = orgRegion; tableRegion.Dispose(); }
/// <summary> /// Paint table cells controls /// </summary> /// <param name="tableRenderer"></param> /// <param name="item"></param> /// <param name="g"></param> /// <param name="cellData"></param> /// <param name="columnsManager"></param> /// <param name="isRowMarked"></param> /// <param name="isSelected"></param> private void PaintCellControls(TableChildRendererBase tableChildRenderer, TableItem item, Graphics g, CellData cellData, ColumnsManager columnsManager, bool isRowMarked, bool isSelected) { //paint cell's controls if (item != null) { LgList tableChildren = getColumnChildren(item, cellData.ColumnIdx, columnsManager); if (tableChildren != null) { foreach (PlacementDrivenLogicalControl lg in tableChildren) { tableChildRenderer.PaintControl(lg, cellData.Rect, g, isRowMarked, isSelected, columnsManager); } } } }
/// <summary> /// paint table cell background /// </summary> public void PaintCellBackground(TableChildRendererBase tableChildRenderer, CellData cellData, Graphics g, TableItem item, bool isRowMarked, bool isSelected, ColumnsManager columnsManager) { using (var cellRegion = new Region(cellData.Rect)) { g.Clip = GetClippingArea(cellRegion, g); //The paining of table rows is done from TableControl.OnPaint(). We should paint selected and marked rows from here. if (isRowMarked) { if (tableChildRenderer.RowHighlitingStyle == RowHighlightType.BackgroundControls || tableChildRenderer.RowHighlitingStyle == RowHighlightType.Background) { Color color = tableChildRenderer.HightlightBgColor; //paint cell background Brush brush = SolidBrushCache.GetInstance().Get(Utils.GetNearestColor(g, color)); g.FillRectangle(brush, cellData.Rect); } } } }
/// <summary> /// paint table row /// </summary> public abstract void PaintRow(TableChildRendererBase tableChildRenderer, TablePaintRowArgs ea, bool isRowMarked, bool isSelected, ColumnsManager columnsManager);