WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

DeleteRow

Removes a specific row from a WS_LIST_CTRL widget.

Ole declaration

VARIANT_BOOL DeleteRowByName(LPCTSTR sObjectName, SHORT usRowIndex);

VARIANT_BOOL DeleteRowById(SHORT usObjectId, SHORT usRowIndex);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usRowIndex
The index of the row that will be deleted.
Return Value

On success, DeleteRow 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.AddRowById(sListCtrlId, 0);
oWidget.AddRowById(sListCtrlId, 0);

/* Using DeleteRow, the last row of the list ctrl is removed */
oWidget.DeleteRowById(sListCtrlId, 2);
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
Case "deleteRowBtn"
	'Deletes a previously selected row
	If wsWidget.GetSelectedItemByName("myListCtrl") <> -1 Then
		wsWidget.DeleteRowByName "myListCtrl", wsWidget.GetSelectedItemByName("myListCtrl")
	End If
...
See also

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

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