I have noticed that when I ADD a column ( 2 ) with code the Autosort for that column has been disabled.
I have a first name and last name field in a recordset and I use an Add column ..
Is there a way to turn on the Autosort for this column FWH 1202 ?
Thanks
Rick Lipkin
- Code: Select all Expand view
DEFINE DIALOG oWork RESOURCE "WORKBROW" of oWndChild
REDEFINE xBROWSE oLBX ;
RECORDSET oRsRepair ;
COLUMNS "RN", ;
"ADDR1", ;
"CITY", ;
"PH", ;
"RT", ;
"STATUS", ;
"TN", ;
"PN", ;
"MN", ;
"MODEL", ;
"SNUM" ;
COLSIZES 65,150,85,85,85,85,85,85,120,120,120 ;
HEADERS "Repair Num", ;
"Address", ;
"City", ;
"Phone", ;
"Request Type", ;
"Status", ;
"Tracking Num", ;
"Pref Tech", ;
"Manufacturer", ;
"Model Number", ;
"Serial Number" ;
ID 172 of oWork ;
AUTOCOLS LINES AUTOSORT CELL
// autosort does not seem to work with columns added with code
ADD oCol TO oLbx AT 2 DATA {|x| x := _ChkCust(oRsRepair:Fields("lname"):Value,;
oRsRepair:Fields("fname"):Value) } HEADER "Customer Name" size 150
ADD oCol TO oLbx AT 5 DATA {|x| x := _ChkComp(oRsRepair:Fields("cc"):Value) };
HEADER "Instructions" size 150
...
...
//-------------------
Static Func _ChkCust( cLast,cFirst )
Local cName
If cFirst = " " .or. empty( cFirst)
cName := substr(alltrim( cLast )+space(40),1,40)
Else
cName := substr(alltrim( cLast )+", "+alltrim(cFirst)+space(40),1,40)
Endif
Return(cName)