Edit this page

Background Grid

You can control the background settings of the diagramming surface through the following properties:

  • IsBackgroundSurfaceVisible: a boolean property that determines whether the background surface of the RadDiagram should be displayed. Its default value is true.

Set IsBackgroundSurfaceVisible


this.radDiagram1.DiagramElement.IsBackgroundSurfaceVisible = true;

Me.RadDiagram1.DiagramElement.IsBackgroundSurfaceVisible = True

IsBackgroundSurfaceVisible = true IsBackgroundSurfaceVisible = false
diagram-backgroundgrid 001 diagram-backgroundgrid 002
  • Background: this property is of type Brush and it controls the fill of the RadDiagram background.

Set Background


this.radDiagram1.DiagramElement.BackgroundGrid.Background = new System.Drawing.SolidBrush(Color.LightYellow);

Me.RadDiagram1.DiagramElement.BackgroundGrid.Background = New System.Drawing.SolidBrush(Color.LightYellow)

Figure 1: Background

diagram-backgroundgrid 003

You can access the BackgroundGrid properties:

  • CellSize: this property is of type Telerik.Windows.Diagrams.Core.Size and it controls the size of the cells in the RadDiagram surface. The default value of this property is a size of *20x20 * units.

Figure 2: CellSize

diagram-backgroundgrid 004

Set CellSize


this.radDiagram1.DiagramElement.BackgroundGrid.CellSize = new Telerik.Windows.Diagrams.Core.Size(40, 40);

Me.RadDiagram1.DiagramElement.BackgroundGrid.CellSize = New Telerik.Windows.Diagrams.Core.Size(40, 40)

  • LineStroke: this property is of type Brush and it specifies how the cells outline is painted.

Figure 3: LineStroke

diagram-backgroundgrid 005

Set LineStroke


this.radDiagram1.DiagramElement.BackgroundGrid.LineStroke = new System.Drawing.SolidBrush(Color.Red);

Me.RadDiagram1.DiagramElement.BackgroundGrid.LineStroke = New System.Drawing.SolidBrush(Color.Red)

  • LineStrokeThickness: this property is of type double and it gets or sets the thickness of the RadDiagram background grid lines.

Figure 4: LineStrokeThickness

diagram-backgroundgrid 006

Set LineStrokeThickness


this.radDiagram1.DiagramElement.BackgroundGrid.LineStrokeThickness = 5;

Me.RadDiagram1.DiagramElement.BackgroundGrid.LineStrokeThickness = 5

See Also