Version

CellPadding Property

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

The CellPadding property determines the amount of space between the edges of a cell and the text of the cell in the band or the grid controlled by the specified override. It is similar to an internal margin for the cell. If you want to control the amount of space that surrounds the cell itself, use the CellSpacing property.

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

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

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

  Private Sub Button32_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button32.Click

      ' Cell padding indicates the amount of space in pixels between the border of the 
      ' cell and it's content.

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

      ' 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.CellPadding = 2

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

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

	// Cell padding indicates the amount of space in pixels between the border of the 
	// cell and it's content.

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

	// 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.CellPadding = 2;

}
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