Use Windows.pkg Use DFClient.pkg Use cReportControlGrid.pkg Use cReportControlGridColumn.pkg Deferred_View Activate_oTest for ; Object oTest is a dbView Set Border_Style to Border_Thick Set Size to 218 379 Set Location to 1 2 Object oReportControlGrid1 is a cReportControlGrid Set Size to 191 355 Set Location to 8 13 Set pbAutoColumnSizing to True // properties from Nils GridControl Set piHeaderStyle to OLExtpColumnOffice2003 Set peAnchors to anAll Set BorderStyle to OLExtpBorderClientEdge Set piCustomDraw to OLExtpCustomBeforeDrawRow Set TextColor to clNavy Set pbAllowColumnRemove to True Set Status_Help to "This is a Report Object with push buttons test." Set psWatermarkBitmap to "Watermark.bmp" Set piWatermarkTransparancy to 10 Set piWatermarkAlignment to OLExtpReportWatermarkCenter // For ReportControlv11.2.2 and later. Set FooterVisibleState to True Set HeaderJustificationMode to (OLExtpAlignmentLeft + OLExtpAlignmentVCenter) Set piReportGridStyle to OLExtpGridSmallDots Set pbAutoColumnSizing to True Set Color to clWindow //Set pbDeleteAllowed to False Object oReportControlGridColumn1 is a cReportControlGridColumn Set Location to 8 9 Set Size to 24 103 Set Label to "Text" End_Object Object oReportControlGridColumn2 is a cReportControlGridColumn Set Location to 7 120 Set Size to 24 45 Set Label to "Checkbox" End_Object Object oReportControlGridColumn3 is a cReportControlGridColumn Set Location to 7 174 Set Size to 24 45 Set Label to "Numeric" End_Object Object oReportControlGridColumn1 is a cReportControlGridColumn Set Location to 9 229 Set Size to 24 45 Set Label to "Shadowed" End_Object Object oReportControlGridColumn1 is a cReportControlGridColumn Set Location to 6 287 Set Size to 24 45 Set Label to "Button" End_Object Object oReportControlGridColumn1 is a cReportControlGridColumn Set Location to 41 230 Set Size to 24 45 Set Label to "Col 6" End_Object Object oReportControlGridColumn1 is a cReportControlGridColumn Set Location to 41 292 Set Size to 24 45 Set Label to "Col 7" End_Object // *** Fill the grid with data: *** Procedure OnFillGrid Handle hColumn hRow iItem Boolean bState Integer i j iCols iRows iRetval iItems Send Cursor_Wait of Cursor_Control Get Col_Count to iCols // The class function is similar to Row_Count and ItemCount. Move 200 to iRows For i from 1 to iRows // *** Create Items/Cells for each row *** // By using a double loop it's easy to know at what column we currently are: For j from 1 to iCols Get Add_Item "" to iItem // Set sample properties for items: If (j = 1) Begin // Make these 'text' cells: Set Value item iItem to ("Text " + String(ItemCount(Self))) // Sample item text. Set ToolTip item iItem to ("Tooltip for Text item (no Button) " + String(piCells(Self))) // Sample Tooltip item text. End Else If (j = 2) Begin Set Value item iItem to ("Checkbox " + String(ItemCount(Self))) // Sample checkbox. Set ToolTip item iItem to ("Tooltip for checkbox " + String(piCells(Self))) // Sample Tooltip item text. Set CheckboxItemState item iItem to True End Else If (j = 3) Begin // Make this to a column for 'numeric' cells: Set Value item iItem to (ItemCount(Self)) Set pbBold item iItem to True Set ToolTip item iItem to "Tooltip for a numeric column." End Else If (j = 4) Begin // Make this column shadowed: Set Value item iItem to ("Text " + String(ItemCount(Self))) // Sample item text. Set ToolTip item iItem to "Tooltip for a shadowed column. You cannot navigate to this column." Get ItemShadowState item iItem to bState End Else Begin // Button column(s): Set pbIsButton item iItem to True Set Icon item iItem to RC_ButtonNormal Set Value item iItem to ("Button " + String(ItemCount(Self))) // Sample item text. Set ToolTip item iItem to ("Tooltip for button " + String(ItemCount(Self))) // Sample Tooltip item text. End // If (i = 1 and j = 1) Begin // Set Extra_State item iItem to 3 // End Loop // For j from 0 to iCols Loop // For i from 0 to iRows // Don't forget! Else the grid content will not be visible! Send Populate Send Cursor_Ready of Cursor_Control End_Procedure // DoFillGrid End_Object Cd_End_Object