Introduced
4.0
Description
Sets a label string for a Column. Labels are optional. The visual appearance of row labels can be tweaked with the siUIGridHideColumnHeader and siUIGridLockColumnHeader attributes (see siPPGItemAttribute).
Scripting Syntax
GridData.SetColumnLabel( ColumnIndex, [Label] )
C# Syntax
GridData.SetColumnLabel( Int32 in_ColumnIndex, String in_Label );
Parameters
|
Parameter |
Type |
Description |
|
ColumnIndex |
Index of the Column. The left-most column has index 0. |
|
|
Label |
New Label, or an empty string to remove the label |
Examples
JScript Example
//Demo of Labels
var oPSet = ActiveSceneRoot.AddProperty("CustomProperty",false,"GridLabelDemo") ;
var oParam = oPSet.AddGridParameter( "mygrid" ) ;
var oLayout = oPSet.PPGLayout;
var oPPGItem = oLayout.AddItem( "mygrid", "", siControlGrid ) ;
oPPGItem.SetAttribute( "NoLabel", true ) ;
oPPGItem.SetAttribute( "LockColumnHeader", true ) ;
oPPGItem.SetAttribute( "CY", 300 ) ;
var oGridData = oParam.Value
oGridData.ColumnCount = 2 ;
oGridData.RowCount = 100 ;
oGridData.SetColumnLabel( 0, "Column 0" ) ;
oGridData.SetColumnLabel( 1, "Column 1" ) ;
for ( var i = 0 ; i < oGridData.RowCount ; i++ )
{
oGridData.SetRowLabel( i, "Row " + i.toString() ) ;
}
oGridData.SetCell( "Column 0", "Row 25", "SomeData" ) ;
if ( oGridData.GetRowLabel( 25 ) != "Row 25" )
{
Logmessage( "Unexpected" ) ;
}
InspectObj( oPSet ) ;
See Also
SOFTIMAGE|XSI v6.01