XPTable.Models.Table.OnPaintGrid C# (CSharp) Method

OnPaintGrid() protected method

Paints the Table's grid
protected OnPaintGrid ( PaintEventArgs e ) : void
e PaintEventArgs A PaintEventArgs that contains the event data
return void
        protected void OnPaintGrid(PaintEventArgs e)
        {
            if (this.GridLines == GridLines.None)
                return;

            if (this.ColumnModel == null || this.ColumnModel.Columns.Count == 0)
                return;

            if (this.ColumnModel != null)
            {
                using (Pen gridPen = new Pen(this.GridColor))
                {
                    gridPen.DashStyle = (DashStyle)this.GridLineStyle;

                    // check if we can draw column lines
                    // kbomb987 - Fix for painting grid lines on parent rows and columns
                    if (this.GridLines == GridLines.Columns || this.GridLines == GridLines.Both)
                    {
                        this.PaintGridColumns(e, gridPen);
                    }

                    if (this.TableModel != null)
                    {
                        switch (this.GridLines)
                        {
                            case GridLines.RowsOnlyParent:
                                PaintGridRowsOnlyParent(e, gridPen);
                                break;
                            case GridLines.RowsColumnsOnlyParent:
                                // kbomb987 - Fix for painting grid lines on parent rows and columns
                                PaintGridRowsColumnsOnlyParent(e, gridPen);
                                break;
                            case GridLines.Both:
                            case GridLines.Rows:
                                PaintGridAllRows(e, gridPen);
                                break;
                            case GridLines.None:
                            case GridLines.Columns:
                                break;
                        }
                    }
                }
            }
        }
Table