Gridlines Class

Represents gridlines that appear in a GanttChart view.
Inheritance Hierarchy
SystemObject
  Aspose.Tasks.VisualizationGridlines

Namespace:  Aspose.Tasks.Visualization
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public class Gridlines

The Gridlines type exposes the following members.

Constructors
  NameDescription
Public methodGridlines
Initializes a new instance of the Gridlines class
Properties
  NameDescription
Public propertyCode exampleInterval
Gets or sets the number from 0 to 99 that specifies the interval between gridlines.
Public propertyCode exampleIntervalColor
Gets or sets the color of secondary gridlines.
Public propertyCode exampleIntervalPattern
Gets or sets the line pattern for secondary gridlines.
Public propertyCode exampleNormalColor
Gets or sets the color of normal gridlines.
Public propertyCode exampleNormalPattern
Gets or sets the line pattern for normal gridlines.
Public propertyCode exampleType
Gets or sets the gridline type.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to work with gridlines.
var project = new Project(DataDir + "Project2.mpp");

var view = (GanttChartView)project.Views.ToList()[0];

// lets tune the first gridline of the view
var gridlines = view.Gridlines[0];
// set the number from 0 to 99 that specifies the interval between gridlines.
gridlines.Interval = 2;
// set the color of secondary gridlines.
gridlines.IntervalColor = Color.Red;
// set the line pattern for secondary gridlines
gridlines.IntervalPattern = LinePattern.Solid;
// set the color of normal gridlines
gridlines.NormalColor = Color.Blue;
// set the line pattern for normal gridlines
gridlines.NormalPattern = LinePattern.CloseDot;
// set the gridline type
gridlines.Type = GridlineType.GanttRow;

project.Save(OutDir + "WorkWithGridlines_out.mpp", SaveFileFormat.MPP);
See Also