property Column.FormatLevel as String
Retrieves or sets a value that indicates the layout of columns being displayed in the column's header.

 TypeDescription 
   String A string expression that indicates a CRD string that layouts the column's header.  The Index elements in the CRD strings indicates the index of the column being displayed. The Caption elements in the CRD string support built-in HTML format.  
By default, the FormatLevel property is empty. The FormatLevel property indicates the layout of the column in the control's header bar. Use the HeaderVisible property to show or hide the control's header bar. Use the HeaderHeight property to specify the height of the level in the control's header bar. Use the FormatLevel property to display multiple levels in the column's header. Use the LevelKey property to display neighbor columns on multiple levels. If the FormatLevel property is empty, the control displays the Caption or the HTMLCaption of the column. If the FormatLevel property is not empty it indicates the layout of the column being displayed. For instance, the FormatLevel = "1,2" indicates that the column's header is horizontally divided such as the left part displays the caption of the first column, and the right part displays the caption of the second column. Use the Visible property to specify whether a column is visible or hidden. Use the Add method to add new columns to the control. Use the DataSource property to bound the control to a recordset. Use the Def(exCellFormatLevel) property to specify the layout for all cells in the same column. Use the CellFormatLevel property to indicate the layout for a specific cell.

The following screen shot shows the control/list's header on 4 different levels, the same as displayed in the chart's area:

 

The following VB sample arranges the columns as in the above screen shot ( the sample hides the columns and add instead two new columns { Personal Info, General Info }, where the layout is displayed. 

With G2antt1
    .BeginUpdate
    Dim c As EXG2ANTTLibCtl.Column
    For Each c In .Columns
        c.Visible = False
    Next
    With .Columns.Add("Personal Info")
        .AllowSort = False
        .AllowDragging = False
        .Width = 196
        .FormatLevel = "18;17/(14:54,(2/1/3))"
    End With
    With .Columns.Add("General Info")
        .AllowSort = False
        .AllowDragging = False
        .Width = 382
        .FormatLevel = "18;18/((7/18;4):128,((((12/10/11),(5/6/9)),15)))"
    End With
    .EndUpdate
End With 

Before running the sample the control's header bar looks like follows:

After running the sample the control's header bar looks like follows:

The following C++ sample arranges the columns as in the above screen shot ( the sample hides the columns and add instead two new columns { Personal Info, General Info }, where the layout is displayed.

m_g2antt.BeginUpdate();
CColumns cols = m_g2antt.GetColumns();
long nCount = cols.GetCount();
for ( long i = 0; i < nCount; i++ )
	cols.GetItem( COleVariant(i) ).SetVisible( FALSE );

CColumn col1( V_DISPATCH( &cols.Add( "Personal Info" ) ) );
col1.SetAllowSort( FALSE );
col1.SetAllowDragging( FALSE );
col1.SetWidth( 196 );
col1.SetFormatLevel( "18;18/(15:54,(2/1/4))" );
CColumn col2( V_DISPATCH( &cols.Add( "General Info" ) ) );
col2.SetAllowSort( FALSE );
col2.SetAllowDragging( FALSE );
col2.SetWidth( 512 );
col2.SetFormatLevel( "18;19/((8/18;5):128,((((13/11/12),(6/7/10)),16)))" );
m_g2antt.EndUpdate();

The following VB.NET sample arranges the columns as in the above screen shot ( the sample hides the columns and add instead two new columns { Personal Info, General Info }, where the layout is displayed.

With AxG2antt1
	.BeginUpdate()
	Dim c As EXG2ANTTLib.Column
	For Each c In .Columns
		c.Visible = False
	Next
	With .Columns.Add("Personal Info")
		.AllowSort = False
		.AllowDragging = False
		.Width = 196
		.FormatLevel = "18;18/(15:54,(2/1/4))"
		.Def(EXG2ANTTLib.DefColumnEnum.exCellFormatLevel) = "15:54,(2/1/4)"
	End With
	With .Columns.Add("General Info")
		.AllowSort = False
		.AllowDragging = False
		.Width = 512
		.FormatLevel = "18;19/((8/18;5):128,((((13/11/12),(6/7/10)),16)))"
		.Def(EXG2ANTTLib.DefColumnEnum.exCellFormatLevel) = "(8/18;5):128,((((13/11/12),(6/7/10)),16))"
	End With
	.EndUpdate()
End With

The following C# sample arranges the columns as in the above screen shot ( the sample hides the columns and add instead two new columns { Personal Info, General Info }, where the layout is displayed.

axG2antt1.BeginUpdate();
foreach( EXG2ANTTLib.Column c in axG2antt1.Columns)
	c.Visible = false;
EXG2ANTTLib.Column c1 = axG2antt1.Columns.Add("Personal Info") as EXG2ANTTLib.Column;
c1.AllowSort = false;
c1.AllowDragging = false;
c1.Width = 196;
c1.FormatLevel = "18;18/(15:54,(2/1/4))";
c1.set_Def(EXG2ANTTLib.DefColumnEnum.exCellFormatLevel,"15:54,(2/1/4)");

EXG2ANTTLib.Column c2 = axG2antt1.Columns.Add("General Info") as EXG2ANTTLib.Column;
c2.AllowSort = false;
c2.AllowDragging = false;
c2.Width = 512;
c2.FormatLevel = "18;19/((8/18;5):128,((((13/11/12),(6/7/10)),16)))";
c2.set_Def(EXG2ANTTLib.DefColumnEnum.exCellFormatLevel,"(8/18;5):128,((((13/11/12),(6/7/10)),16))");
axG2antt1.EndUpdate();

The following VFP sample arranges the columns as in the above screen shot ( the sample hides the columns and add instead two new columns { Personal Info, General Info }, where the layout is displayed.

with thisform.G2antt1
	.BeginUpdate()
	with .Columns
		for i = 0 to .Count - 1
		.Item(i).Visible = .f.
	next
	with .Add("Personal Info")
		.AllowSort = .f.
		.AllowDragging = .f.
		.Width = 196
		.FormatLevel = "18;18/(15:54,(2/1/4))"
		.Def(32) = "15:54,(2/1/4)"
	endwith
	with .Add("General Info")
		.AllowSort = .f.
		.AllowDragging = .f.
		.Width = 512
		.FormatLevel = "18;19/((8/18;5):128,((((13/11/12),(6/7/10)),16)))"
		.Def(32) = "(8/18;5):128,((((13/11/12),(6/7/10)),16))"
	endwith
	endwith
	.EndUpdate()
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.