WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetRowText

This methods retrieves the text displayed by a cell on a WS_LIST_CTRL widget.

Ole declaration

BSTR GetRowTextByName(LPCTSTR sObjectName, SHORT usRowIndex, SHORT usColumnIndex);

BSTR GetRowTextById(SHORT usObjectId, SHORT usRowIndex, SHORT usColumnIndex);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usRowIndex
The zero based index of the target row.
usColumnIndex
The zero based index of the target column.
Return Value

On success, GetRowText returns the text displayed by the target cell. On error GetSelectedItem returns an empty string. To get extended information, call WStError::GetLastErrorCode.

Remarks
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, "44123");
string sText = oWidget.GetRowTextById(sListCtrlId, 0, 0);
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
 Case "newRowTextField"
	sEventValue = wsForm.GetLastEventStrValue()
	'Changes the text of the first column of a previously selected row
	If wsWidget.GetSelectedItemByName("myListCtrl") <> -1 Then
		wsWidget.SetRowTextByName "myListCtrl", wsWidget.GetSelectedItemByName("myListCtrl"), _
			0, sEventValue
	End If
...
See also

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

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