Version

CellSpacing Property

Returns or sets the amount of spacing, in pixels, between cells. Also determines the spacing between the cell's border and the row's border.
Syntax
'Declaration
 
Public Property CellSpacing As Integer
public int CellSpacing {get; set;}
Remarks

The CellSpacing property determines the amount of empty space in a row that will surround each cell in the band or the grid controlled by the specified override. Spacing between cells allows the background of the underlying row to become visible, along with any color, transparency or background picture that was assigned to the UltraGridRow object. Cell spacing adds space equally on all sides of the cell - top, bottom, left and right.

Setting CellSpacing to a value of -1 will cause it to use the value from the next highest object in the override hierarchy.

This property does not have any effect on the inside of the cell. To control the cell's interior spacing, use the CellPadding property.

Example
Following code sets the CellSpacing on the layout's override and a band's override.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button31_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button31.Click

      ' Cell spacing indicates the amount of space in pixels between cells.

      ' Set the CellSpacing on the layout's Override to 2. All cells in the UltraGrid will
      ' have cell spacing of 2 pixels.
      Me.UltraGrid1.DisplayLayout.Override.CellSpacing = 2

      ' You can override that grid-wide setting for a particular band by setting it on the
      ' override of that band.
      Me.UltraGrid1.DisplayLayout.Bands(0).Override.CellSpacing = 4

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button31_Click(object sender, System.EventArgs e)
{

	// Cell spacing indicates the amount of space in pixels between cells.

	// Set the CellSpacing on the layout's Override to 2. All cells in the UltraGrid will
	// have cell spacing of 2 pixels.
	this.ultraGrid1.DisplayLayout.Override.CellSpacing = 2;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.
	this.ultraGrid1.DisplayLayout.Bands[0].Override.CellSpacing = 4;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also