BBjStandardGrid::setSelectedCell

Description

This method selects a cell in the BBjStandardGrid.

Syntax

Return Value

Method

void

setSelectedCell(int row, int col)

void

setSelectedCell(BBjGridCell gridCell!)

Parameters

Variable

Description

keyrow

Specifies the 0-based row.

col

Specifies the 0-based column.

gridCell!

Specifies the BBjGridCell-based cell.

Return Value

None.

Remarks

If the grid's selection mode is set to GRID_SELECT_CELL, then the specified cell will be highlighted. If the grid's selection mode is set to GRID_SELECT_ROW or getShouldHighlightSelectedRow() returns true, then the whole row containing the selected cell will be highlighted. If the grid's selection mode is set to GRID_SELECT_COLUMN or getShouldHighlightSelectedColumn() returns true, then the whole column containing the selected cell will be highlighted.

Example

gui! = BBjAPI().openSysGui("X0")
wnd! = gui!.addWindow(gui!.getAvailableContext(),100,50,500,400,"GridTest")
grd! = wnd!.addGrid(wnd!.getAvailableControlID(),32,24,252,133)
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.
grd!.setSelectedCell(1,0)
?grd!.getSelectedCell()

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

process_events

close:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjGrid

BBjGrid::getSelectedCells

BBjGrid::setEnhancedModelEnabled

BBjGridCell

BBjVector

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