Define Fields/Columns in the SQL as a key and display the lookup instead of the raw key value.
Obj.dbLookUpFlds = "FieldNameNum-1| Key | Lookup, FieldNameNum-2| Key | Lookup, ....repeat"
| Keyword | Description |
|---|---|
| FieldNameNum | Field name or field number of the active table that requires lookup |
| Key | Name of Master Index to use. The item in the field will match the corresponding in the Key List |
| Lookup | Name of LookUp Index to use. Value from this list will be returned |
This example lookup the employeeid and reportsto field and display the first & last names instead.
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim XL As New Tornado.z
With XL
.dbQP = "U=8| M=ty=dh!sys=t| S=aspdb| D=NWIND| Q=employees|" & _
"Gdf=0| Fmhf=0| Ps=10|Mts=128| Th=Ti=LookUp"
.dbGridMagicCell = "field=EmployeeID|alias=My ID is - #0#"
.dbCommonTables = "index=EID,FullName|sql=Select employeeid," & _
"Firstname & ' ' & Lastname from employees"
.dbLookUpFlds = "field=ReportsTo|keyindex=EID|lookupindex=FullName," & _
"field=Employeeid| keyindex=EID|lookupindex=FullName"
.ASPdbNET()
End With
End Sub
</script>
z Class | Tornado Namespace | dbCommonTables | Special Topic - Lookup & Dropdown