ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Freezing Columns

To freeze columns in the grid, set the Frozen property to True. Freezing columns locks them from being scrolled and also prevents all columns with a lesser index from being scrolled. This property can be set either in the designer or in code.

In the Designer

1.   Open the TrueDBGrid Designer. For information on how to access the TrueDBGrid Designer, see Accessing the TrueDBGrid Designer.

2.   In the designer, select the Last column by clicking it in the right pane.

The column can also be selected by choosing Last from the drop-down list in the toolbar.

3.   Click the Display Column tab in the left pane.

4.   Locate the Frozen property and set it to True.

5.   Click OK to close the designer.

In Code

Add the following code to the Form_Load event to freeze the Last column:

·      Visual Basic

Me.C1TrueDBGrid1.Splits(0).DisplayColumns("Last").Frozen = True

·      C#

this.c1TrueDBGrid1.Splits[0].DisplayColumns["Last"].Frozen = true;

·      Delphi

Self.C1TrueDBGrid1.Splits[0].DisplayColumns['Last'].Frozen := True;

This topic illustrates the following:

Both the First and Last columns are frozen and will remain on the grid when it is scrolled to the right.


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