WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetRowText

Sets the text displayed by a cell/item on a WS_LIST_CTRL widget.

Ole declaration

VARIANT_BOOL SetRowTextByName(LPCTSTR sObjectName, SHORT usRowIndex, SHORT usColumnIndex, LPCTSTR sText);

VARIANT_BOOL SetRowTextById(SHORT usObjectId, SHORT usRowIndex, SHORT usColumnIndex, LPCTSTR sText);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usRowIndex
The item's row index.
usColumnIndex
The item's column index.
sText
Specifies the new text that will be displayed by an item.
Return Value

On success, SetRowText returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks

To use this method the current load mode must be WS_LIST_CTRL_LOAD_FROM_MEM (See SetLoadMode for more details).

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short sListCtrlId= 4;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, "");
oWidget.AddColumById(sListCtrlId, 40, "Product Id");
oWidget.AddRowById(sListCtrlId, 0);
oWidget.SetRowTextById(sListCtrlId, 0, 0, "33413");
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
wsWidget.SetRowTextByName "myListCtrl", 0, 0, "R0C0"
wsWidget.SetRowTextByName "myListCtrl", 1, 1, "R1C1"
wsWidget.SetRowTextByName "myListCtrl", 2, 2, "R2C2"
wsWidget.SetRowTextByName "myListCtrl", 3, 3, "R3C3"
wsWidget.SetRowTextByName "myListCtrl", 4, 4, "R4C4"
...
See also

DeleteRow | SetRowIcon | AddRow | ClearRows | AddColumn | ClearColumns | GetSelectedItem | ReadRowsFromFile | SetLoadMode

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference