BBjGridColumnSelectionChangedEvent::getSelectedColumnCount

Description

In BBj 19.20 and higher, if the grid is in multiple selection mode (BBjGrid::setMultipleSelection), this method returns the number of currently selected columns in a grid.

Syntax

Return Value Method
int getSelectedColumnCount()

Parameters

None.

Return Value

This method returns the number of currently selected columns.

Remarks

This method will only work when BBjGrid::setSelectionMode is set to GRID_SELECT_COLUMN and fires when one or more columns are either selected or deselected.

Example

sysgui = unt
open (sysgui)"X0"

declare BBjAPI bbjapi!
declare BBjSysGui sysgui!
declare BBjTopLevelWindow window!
declare BBjStandardGrid grid!

bbjapi! = BBjAPI()
sysgui! = bbjapi!.getSysGui()
window! = sysgui!.addWindow(100,100,400,300,"Test Grid getSelectedCount",$00010003$)
window!.setCallback(bbjapi!.ON_CLOSE,"eoj")

rows=10,cols=10
grid! = window!.addGrid(101,10,10,580,350)

rem 'grid!.setEnhancedSelectionModelEnabled(1)

grid!.setDefaultColumnWidth(50)
grid!.setRowHeight(23)
grid!.setMultipleSelection(1)
grid!.setSelectionMode(grid!.GRID_SELECT_COLUMN)
grid!.setNumRows(rows)
grid!.setNumColumns(cols)
gridvec! = bbjapi!.makeVector()
for row = 0 to rows-1
    for col = 0 to cols-1
        text$=str(row:"00")+","+str(col:"00")
        gridvec!.addItem(text$)
    next col
next row
grid!.setCellText(0,0,gridvec!)

grid!.setCallback(grid!.ON_COLUMN_SELECTION_CHANGE,"column_selection_changed")
counter = 0

process_events

eoj:
release

column_selection_changed:
    Print "Column Selection Changed"
    ev! = cast(BBjGridColumnSelectionChangedEvent,sysgui!.getLastEvent())
    Print "ev!.getColumn()= ",ev!.getColumn()
    Print "ev!.getSelectedColumnCount()= ",ev!.getSelectedColumnCount()
    Print "ev!.getSelectedColumns() = ", ev!.getSelectedColumns()
    Print "grid!.getSelectedColumns().size()= ",grid!.getSelectedColumns().size()
    Print
    counter = counter + 1
    Print counter
    Print
return

ClosedVersion History

  • BBj 19.20: Added BBjGridColumnSelectionChangedEvent::getSelectedColumnCount.

See Also

BBjAPI

BBjControl::setCallback

BBjGrid

BBjGridCellSelectionChangedEvent

BBjGridRowSelectionChangedEvent

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