ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Split.SplitSizeMode Property

Gets or sets a value indicating how the SplitSize property is used to determine the actual size of a split.

[Visual Basic]

Public Property SplitSizeMode As SizeModeEnum

[C#]

public SizeModeEnum SplitSizeMode {get;set;}

[Delphi]

public property SplitSizeMode: SizeModeEnum read get_SplitSizeMode write set_SplitSizeMode;

Remarks

If set to SizeModeEnum.Scalable (the default), then the value returned by the SplitSize property is an integer indicating the relative size of the split with respect to other scalable splits. For example, if a grid contains 3 scalable splits with SplitSize properties equal to 1, 2, and 3, then the size of each split would be 1/6, 1/3, and 1/2 of the total grid width, respectively.

If set to SizeModeEnum.Exact, then the value returned by the SplitSize property is a floating point number indicating the exact size of the split in terms of the coordinate system of the grid's container. This setting allows the size of the split to be adjusted so that it always has the same width, even if new splits are added or existing splits are removed.

If set to SizeModeEnum.NumberOfColumns, then the value returned by the SplitSize property is an integer indicating the number of columns displayed in the split, and the split will adjust its width to display the number of full columns specified by the SplitSize property. For example, if SplitSize is set to 2, and the user scrolls the split horizontally, then the width of the split will change so that 2 full columns are displayed, regardless of how wide the columns are.

Note: Consider a grid containing both scalable splits and splits with a fixed number of columns. If a split with a fixed number of columns is scrolled horizontally, the total width remaining for the scalable splits may change because grid columns are generally of different widths. However, the ratios of the sizes of the scalable splits remain the same as specified by their SplitSize properties.

Note that when there is only one split (the grid's default behavior), the split spans the entire width of the grid, the SplitSizeMode property is always SizeModeEnum.Scalable, and the SplitSize property is always 1. Setting either of these properties has no effect when there is only one split. If there are multiple splits, and all but one is removed, the SplitSizeMode and SplitSize properties of the remaining split automatically revert to SizeModeEnum.Scalable and 1, respectively.

Example

In this example, the SplitSizeMode property has been set to SizeModeEnum.Exact, so the split always has the same width, 250 in this case, regardless of whether splits are added or removed:

·      Visual Basic

       Me.C1TrueDBGrid1.Splits(0).SplitSizeMode = SizeModeEnum.Exact

       Me.C1TrueDBGrid1.Splits(0).SplitSize = 250

·      C#

       this.c1TrueDBGrid1.Splits[0].SplitSizeMode = SizeModeEnum.Exact;

       this.c1TrueDBGrid1.Splits[0].SplitSize = 250;

·      Delphi

       Self.C1TrueDBGrid1.Splits[0].SplitSizeMode := SizeModeEnum.Exact;

       Self.C1TrueDBGrid1.Splits[0].SplitSize := 250;

See Also

Split Class | Split Members | C1.Win.C1TrueDBGrid Namespace


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