BBjStandardGrid::isColumnSortedByRelatedData

Description

In BBj 6.00 and higher, this method returns whether a specified column is sorted by the related data.

Syntax

Return Value Method

boolean

isColumnSortedByRelatedData(int columnIndex)

Parameters

Parameter

Description

columnIndex

Specifies the zero-based index of the column.

Return Value

Returns whether the specified column is set to be sorted by related data.

  • true (1) = The column is sorted by related data.
  • false (0) = The column is not sorted by related data.

Remarks

None.

Example

rem ' BBjStandardGrid::isColumnSortedByRelatedData

sysgui = unt
open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

title$ = "BBjStandardGrid::isColumnSortedByRelatedData"

window! = sysgui!.addWindow(50,50,600,400,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"APP_CLOSE")

grid! = window!.addGrid(101,25,25,550,300,$81ca$,10,3)
grid!.setRowHeight(25)
grid!.setFitToGrid(1)
grid!.setEditable(1)
grid!.setLineColor(BBjColor.LIGHT_GRAY)
grid!.setColumnHeaderCellText(0,"Greek Letter")
grid!.setColumnHeaderCellText(1,"Related")
grid!.setColumnHeaderCellText(2,"Text Order")
grid!.setCallback(grid!.ON_GRID_EDIT_STOP,"resort")

rem ' Create some data to fill the grid with
rem ' Spell out the first 10 Greek letters in English,
rem ' and specify their order with related data.
restore 0
dim alpha$[0:9],relatedData[0:9]
dread alpha$[],relatedData[]

data "Alpha","Beta","Delta","Epsilon","Eta","Gamma","Iota","Kappa","Theta","Zeta"
data 1,2,4,5,7,3,9,10,8,6

for row = 0 to 9
  grid!.setCellData(row,0,alpha$[row],str(relatedData[row]:"00"))
  grid!.setCellText(row,1,str(relatedData[row]))
  grid!.setCellText(row,2,str(row))
next row

grid!.setColumnSortedByRelatedData(0,0)
grid!.setColumnUserSortable(0,1)

toggle$ = "BBjStandardGrid::isColumnSortedByRelatedData"
toggle! = window!.addCheckBox(102,25,340,550,30,toggle$,$$)
toggle!.setCallback(toggle!.ON_CHECK_CHANGE,"toggle_sort")

status! = window!.addStatusBar(99)

process_events

app_close:
  release

resort:
  print "BBjStandardGrid::resort()"
  grid!.resort()
return

toggle_sort:
  related! = grid!.isColumnSortedByRelatedData(0)
  related! = !(related!)
  status$ = "setColumnSortedByRelatedData(0," + Boolean.toString(related!) + ")"
  status!.setText(status$)
  grid!.unsort()
  grid!.setColumnSortedByRelatedData(0,related!)
  grid!.sortByColumn(0,BBjGrid.SORT_ASCENDING)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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