v4.0
列のラベル文字列を設定します。ラベルはオプションです。行ラベルの外観は、siUIGridHideColumnHeader および SiUIGridLockColumnHeader 属性で調整できます(siPPGItemAttribute を参照)。
GridData.SetColumnLabel( Int32 in_ColumnIndex, String in_Label ); |
GridData.SetColumnLabel( ColumnIndex, [Label] ); |
//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 ) ; |