WireLess Studio Widgets Developer's Guide |
This method reads the rows of a WS_LIST_CTRL widget from a file.
VARIANT_BOOL ReadRowsFromFileByName(LPCTSTR sObjectName, LPCTSTR sLocalFileName, LPCTSTR sRemoteFileName);
VARIANT_BOOL ReadRowsFromFileById(SHORT usObjectId, LPCTSTR sLocalFileName, LPCTSTR sRemoteFileName);
On success, ReadRowsFromFile returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
To use this method the current load mode must be WS_LIST_CTRL_LOAD_FROM_MEM (See SetLoadMode for more details).
Each row in the data file must be separated by a new line, also each column must be separated by a semicolon (";").
a;s;d;f;g aliquet.diam@eunulla.edu;;Nampa;78306;Niue; Donec@sodalesat.org;1 87 707 3855-6484;Chicopee;78265;Bahamas enim.commodo.hendrerit@etipsumcursus.ca;1 80 239 9006-3928;Mankato;08995;Romania
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); RFFile oFile = new RFFile(); short sListCtrlId= 4; oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, ""); oWidget.AddColumById(sListCtrlId, 40, "Product Id"); oFile.RFTransferFile("../SamplesWidgets\Exe\Resources\data.txt", oFile.GetRemoteTempFolder() + "\data.txt", True); oWidget.SetLoadModeById(sListCtrlId, (short)WSTWidgetConstants.WS_LIST_CTRL_LOAD_FROM_FILE); oWidget.ReadRowsFromFileById(sListCtrlId, "../SamplesWidgets\Exe\Resources\data.txt", sRemoteTempFolder + "\data.txt");
Public wsWidget As New WStWidget ... Case "loadRowsFromDataBtn" 'Fulfills the WS_LISTCTRL widget using the data.txt file wsWidget.SetLoadModeByName "myListCtrl", WS_LIST_CTRL_LOAD_FROM_FILE wsWidget.ReadRowsFromFileByName "myListCtrl", "../SamplesWidgets\Exe\Resources\data.txt", _ sRemoteTempFolder + "\data.txt" ...
SetRowText | DeleteRow | SetRowIcon | AddRow | ClearRows | AddColumn | ClearColumns | GetSelectedItem | SetLoadMode
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |