BBjGrid::setSelectedRows


Description

In BBj 12.0 and higher, this method selects multiple rows in the BBjGrid.

Syntax

Return Value

Method

void

setSelectedRows(BBjVector selection!)

Parameters

Variable

Description

selection!

Specifies a vector of 0-based rows.

Return Value

None.

Remarks

This method is a no-op if getMultipleSelection() returns false.

If selection mode is by row, then the whole row is selected. If selection mode is by column or cell, then the row at the current column is selected.

Example

print "LookAndFeel: ",javax.swing.UIManager@.getLookAndFeel()
print "System LnF: ",javax.swing.UIManager@.getSystemLookAndFeelClassName()

open (201)"X0"
sg!=BBjApi().getSysGui()
Window!=sg!.addWindow(10,10,400,500,"BBjGrid and JTable")
rows = 10
cols = 10
Grid!=Window!.addGrid(200,12,12,360,200)
grid!.setNumColumns(cols)
grid!.setNumRows(rows)
grid!.setFitToGrid(3)

grid!.setHorizontalScrollable(1)
grid!.setVerticalScrollable(1)

grid!.setMultipleSelection(1)
?"selectedRows: ",grid!.getSelectedRows()
?"selectedCols: ",grid!.getSelectedColumns()

rows!=bbjapi().makeVector()
rows!.add(3)
rows!.add(4)
rows!.add(5)
grid!.setSelectedRows(rows!)
?"selectedRows: ",grid!.getSelectedRows()
?"selectedCols: ",grid!.getSelectedColumns()

cols!=bbjapi().makeVector()
cols!.add(2)
cols!.add(4)
cols!.add(5)
grid!.setSelectedColumns(cols!)

?"selectedRows: ",grid!.getSelectedRows()
?"selectedCols: ",grid!.getSelectedColumns()

process_events

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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