New to Telerik UI for WinFormsStart a free 30-day trial

Background Grid

Updated over 6 months ago

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

C#
            
this.radDiagram1.DiagramElement.IsBackgroundSurfaceVisible = true;
IsBackgroundSurfaceVisible = trueIsBackgroundSurfaceVisible = false
WinForms RadDiagram diagram-backgroundgrid 001WinForms RadDiagram diagram-backgroundgrid 002
  • Background: this property is of type Brush and it controls the fill of the RadDiagram background.

Set Background

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

Figure 1: Background

WinForms RadDiagram Background

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

WinForms RadDiagram CellSize

Set CellSize

C#
            
this.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

WinForms RadDiagram LineStroke

Set LineStroke

C#
            
this.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

WinForms RadDiagram LineStrokeThickness

Set LineStrokeThickness

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

See Also

In this article
See Also
Not finding the help you need?
Contact Support