BBjGrid::getSelectedCells

Description

In BBj 15.00 and higher, this method returns a BBjVector containing the selected cells in a grid. If the grid is in multiple selection mode (BBjGrid::setMultipleSelection), then the BBjVector may contain multiple cells.

Syntax

Return Value

Method

BBjVector

getSelectedCells()

Parameters

None.

Return Value

The BBjVector returned contains zero or more BBjGridCell indicating the currently selected cells.

Remarks

This method only works in Enhanced Selection Mode.

Example

gui! = BBjAPI().openSysGui("X0")
wnd! = gui!.addWindow(gui!.getAvailableContext(),100,50,500,400,"Grid Test")
grd! = wnd!.addGrid(wnd!.getAvailableControlID(),32,24,252,133)
grd!.setEnhancedSelectionModelEnabled(1)
grd!.setNumColumns(2)
grd!.setFitToGrid(BBjGrid.AUTO_RESIZE_NEXT_COLUMN)

vec! = new BBjVector()
vec!.addItem("1")
vec!.addItem("Item 1")
vec!.addItem("2")
vec!.addItem("Item 2")
vec!.addItem("3")
vec!.addItem("Item 3")

grd!.setNumRows(3)
grd!.setCellText(vec!)

rem ' SelectedCell calls are here.

cellvec! = new BBjVector()
cell1! = grd!.makeCell(0,0)
cell2! = grd!.makeCell(1,1)
cell3! = grd!.makeCell(2,0)
cellvec!.add(cell1!)
cellvec!.add(cell2!)
cellvec!.add(cell3!)

grd!.setSelectedCells(cellVec!)
?grd!.getSelectedCells()

wnd!.setCallback(wnd!.ON_CLOSE,"close")

process_events

close:
release

See Also

BBjAPI

BBjWindow

BBjGrid

BBjGrid::isEnhancedSelectionModelEnabled

BBjGrid::setEnhancedSelectionModelEnabled

BBjGrid::setSelectedCells

Enhanced Grid Selection Model

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