GrapeCity MultiRow Windows Forms Documentation
Margins and Padding

In cells, you can specify two sizes, one is the Margin depicting the space between cells, and the other is Padding depicting the space inside the cells. The following image shows a column in which buttonCell1 has a margin and padding of 10 pixels on all four sides. The blue line shows the margin and the red lines show the padding. The margin and padding have not been changed in buttonCell2 and buttonCell3.

Margin and Padding

Margins

The margin can be set using the CellStyle.Margin property. If you set the margins, you will be able to adjust the distance between the cells when using the snaplines in the designer. Margins cannot be used when the snaplines are disabled or at runtime.

Padding

The padding can be set using the CellStyle.Padding property. The padding settings can affect the display of the cell contents. The extent of the affect depends on how the cell type has been implemented. Cell borders and border color are not affected by padding.

Using Code

This example sets the padding.

[VB]

Imports GrapeCity.Win.MultiRow

Dim template As Template = New Template()
Dim buttonCell1 As ButtonCell = New ButtonCell()

buttonCell1.Name = "buttonCell1"
buttonCell1.Style.Padding = New Padding(20)
buttonCell1.Size = New Size(80, 60)
buttonCell1.Location = New Point(10, 10)

template.Width = 100
template.Row.Cells.Add(buttonCell1)
template.Row.Height = 80

GcMultiRow1.Template = template
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow;  

Template template = new Template();
ButtonCell buttonCell1 = new ButtonCell();

buttonCell1.Name = "buttonCell1";
buttonCell1.Style.Padding = new Padding(20);
buttonCell1.Size = new Size(80, 60);
buttonCell1.Location = new Point(10, 10);

template.Width = 100;
template.Row.Cells.Add(buttonCell1);
template.Row.Height = 80;

gcMultiRow1.Template = template;
gcMultiRow1.RowCount = 10;
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options