Tornado API Library - V12.30.08

z.dbSortFlds Property

Fields in Grid to be sorted (0 based). When specified, the Up/Dn sort arrows will be added to the Column header.

Product Version


Property Value

Mydb.dbSortFlds="FieldName or FieldNumber in Grid to be sorted (0 based)"

Mydb.dbSortFlds = "0,1,2,3"

Mydb.dbSortFlds = "employeeid, 1, firstname"

QuickProp Keyword Abbreviation



There are three states to the sort - ASC(Up Arrow) | DESC(Dn Arrow) | None(No Arrow). This capability is built-in. The sort supports multiple fields. Click on up or dn arrow will toggle the sort. Click the opposite sort order arrow will change the sort direction and maintain the sort order. Click the same sort order will set the sort state to None. Inspect the status bar for sort order.

Multiple fields sort is advanced and sometime confusing. If single field sort mode (classic ASP-db) is desired - use dbOptions="SingleColumnSort=true". Single field sort means only one field column is sorted at any time.


<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim CS As New Tornado.z
  With CS
      .dbQP = "U=12| S=17|Gdf=0,1,2,3,4| D=Nwind| Q=Orders| Th=tit=Single Col Sort"
      .dbSortFlds = "0,1,employeeid,3"
      .dbSortColLeftJustify = True
      '...Following option force single column sort
      .dbOptions = "SingleColumnSort=true"
  End With
End Sub

See Also

z Class | Tornado Namespace | dbColSortSQL | dbInitSortCols | dbSortColLeftJustify | dbOptions