Spread ASP.NET 18
Spread for ASP.NET 18 Product Documentation / Developer's Guide / Customizing the Appearance / Customizing the Appearance of the Sheet / Displaying Grid Lines on the Sheet
In This Topic
    Displaying Grid Lines on the Sheet
    In This Topic

    You can display grid lines on the sheet that distinguish rows or columns (or both). You can set the grid lines to display using the GridLines property for the sheet (which uses the settings of the GridLines enumeration in the underlying Microsoft .NET framework).

    You can set the color of the grid lines. In the following figure, where both the horizontal and vertical lines are displayed, the grid lines are red.

    Sheet with red gridlines

    You can also set the grid lines and the grid lines color by defining these properties in the SheetSkin class and then applying the skin to the sheet. For more information creating and applying skins, refer to Applying a Skin to a Sheet and Creating a Skin for Sheets.

    To set borders around individual cells, refer to Customizing Cell Borders.

    Using the Properties Window

    1. At design time, in the Properties window, select the Sheets property for the FpSpread component.
    2. Click the button to display the SheetView Collection Editor.
    3. In the Members list, select the sheet for which you want to set the grid line color.
    4. Select the GridLineColor property in the property list, and then click the drop-down button to display the color picker.
    5. Select a color in the color picker.
    6. Click OK to close the editor.

    Using a Shortcut

    Set the GridLines and GridLineColor properties of the FpSpread component Sheets shortcut.

    Example

    This example code sets the grid line color to red and displays the row grid lines.

    C#
    Copy Code
    // Set the grid line color to red.
    FpSpread1.Sheets[0].GridLineColor = System.Drawing.Color.Red;
    FpSpread1.Sheets[0].GridLines = GridLines.Horizontal;
    
    VB
    Copy Code
    ' Set the grid line color to red.
    FpSpread1.Sheets(0).GridLineColor = System.Drawing.Color.Red
    FpSpread1.Sheets(0).GridLines = GridLines.Horizontal
    

    Using the Spread Designer

    1. Select the Settings menu.
    2. From the sheets displayed at the bottom, select the sheet for which you want to set the grid line color.
    3. Select the GridLines icon in the Sheet Setting section.
    4. Set the color or any other grid properties.
    5. Click OK to close the dialog.
    6. Click Apply and Exit to close the Spread Designer.