Performs the default painting.

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public void PaintAll()
Visual Basic
Public Sub PaintAll
Visual C++
public:
void PaintAll()
F#
member PaintAll : unit -> unit 

Remarks

This method can be called to do the default painting in the Grid. You can add additional painting and then prevent the Grid from default painting by setting the Handled property to true.

Examples

Demonstrates how to draw a text behind the Rows
 Copy imageCopy
public void InitializeGrid(Grid grid)
{
    //Add event handler for the PaintBackground event 
    grid.PaintBackground += delegate(object sender, PaintBackgroundEventArgs e)
    {
        //Do default painting 
        e.PaintAll();
        e.Handled = true;

        //Draw a string in a middle of the grid behind rows
        using (Font font = new Font("Arial", 20, FontStyle.Bold | FontStyle.Italic))
        using (StringFormat sf = new StringFormat())
        {
            sf.LineAlignment = StringAlignment.Center;
            sf.Alignment = StringAlignment.Center;
            e.Graphics.DrawString("Dapfor .Net Grid", font, SystemBrushes.GrayText, grid.ClientRectangle, sf);
        }
    };
}

See Also