BBjGrid::setRowEditable

Description

In BBj 5.00 and higher, this method sets whether a row is editable in the BBjGrid.

Syntax

Return Value

Method

void

setRowEditable(int row, boolean editable)

Parameters

Variable

Description

row

Specifies the zero-based row.

editable

Specifies whether the row is editable.

0 = Not editable

1 = Editable

Return Value

None.

Remarks

By default, rows are not editable. The overall editability of the grid takes precedence. If the grid is set to non-editable, this method has no effect.

Example

rem 'set only the first row of the grid editable

rem 'Obtain the instance of the BBjAPI object
let myAPI!=BBjAPI()

rem 'Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui!=myAPI!.getSysGui()

rem 'Set addWindow param values
X=10
Y=10
WIDTH=400
HEIGHT=400
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)

rem 'Add a grid on the window
myGrid! = myWindow!.addGrid(101,50,100,300,300,$8060$,4,2)

rem 'Set the grid properties
myGrid!.setDefaultColumnWidth(130)
myGrid!.setGridEditable(1)

rem 'Add text to the grid cells
FOR ROW = 0 TO 3
    FOR COL = 0 TO 1
        CELLTEXT$="ROW = " + STR(ROW+1) + ", COL = " + STR(COL+1)
        myGrid!.setCellText(ROW,COL,CELLTEXT$)
    NEXT COL
NEXT ROW

rem 'set only row 0 editable
for I = 1 to 3
    myGrid!.setRowEditable(I,0)
next I

rem 'print out which rows are editable
for I = 1 to 4
    isroweditable=myGrid!.isRowEditable(I-1)
    if (isroweditable=0) then
        print "row #"+str(I-1)+" is not editable"
    else
        print "row #"+str(I-1)+" is editable"
    endif
next I

rem 'Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.