ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Formatting Merged Cells

Use the HorizontalAlignment and VerticalAlignment properties of the column's Style object to center the data within the merged cell, as in the following figure.

In the Splits Collection Editor, access these properties by expanding the Style property node at the same level of the tree as the Merge property. Or, in code:

·      Visual Basic

With Me.C1TrueDBGrid1.Splits(0).DisplayColumns("Country").Style

    .HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center

    .VerticalAlignment = C1.Win.C1TrueDBGrid.AlignVertEnum.Center

End With

·      C#

C1.Win.C1TrueDBGrid.Style s;

s = this.c1TrueDBGrid1.Splits[0].DisplayColumns["Country"].Style;

s.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;

s.VerticalAlignment = C1.Win.C1TrueDBGrid.AlignVertEnum.Center;

·      Delphi

with Self.C1TrueDBGrid1.Splits[0].DisplayColumns['Country'] do

begin

  HorizontalAlignment := C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;

  VerticalAlignment := C1.Win.C1TrueDBGrid.AlignVertEnum.Center;

end;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.