# Draw Gridlines on Chart

Get started with MultiSelect, a WinForms control that makes selecting multiple objects from a list or a collection of selected items easy. See more in documentation here.

## Content

FlexChart provides you the option to draw gridlines in front of or behind the chart data. For this, the control provides [AxesOnTop](/componentone/docs/win/online-flexchart/) property of <span data-popup-content="This class is present both in \u003ca href=\u0022/componentone/docs/win/online-flexchart/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexchart/\u0022\u003e.NET\u003c/a\u003e assemblies." data-popup-title="FlexChart" data-popup-theme="ui-tooltip-green qtip-green">FlexChart</span> class to control the appearance of gridlines.

![A moving image which shows gridlines on chart data.](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/draw-gridline.gif)

Here, in the above use-case, we have used a button event to draw gridlines on chart at runtime.

```csharp
private void button1_Click(object sender, EventArgs e)
{
    // for Odd clicks, ie., if the user clicks for the first time, the third time and so on.
    if (myVar % 2 == 0)
    {
        flexChart1.AxesOnTop = true;
    }
    // for Even clicks, if the user clicks for the second time, the fourth time and so on.
    else
    {
        flexChart1.AxesOnTop = false;
    }
    // Increment myVar.  
    myVar = myVar + 1;
}
```

```vbnet
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
     ' for Odd clicks, ie., if the user clicks for the first time, the third time and so on.
    If myVar Mod 2 = 0 Then
         flexChart1.AxesOnTop = True
     Else
    ' for Even clicks, if the user clicks for the second time, the fourth time and so on.
         flexChart1.AxesOnTop = False
     End If
    'Increment myVar
    myVar = myVar + 1
 End Sub
```