//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 ) ;
|