BBjGrid::setSelectedColumns

Description

In BBj 12.00 and higher, this method selects multiple columns in the BBjGrid.

Syntax

Return Value

Method

void

setSelectedColumns(BBjVector selection!)

Parameters

Variable

Description

selection!

Specifies a vector of 0-based columns.

Return Value

None.

Remarks

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

If selection mode is by column, then the whole column is selected. If selection mode is by row or cell, then the column at the current row 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.