WebListBox.Cell

From Real Software Documentation

Jump to: navigation, search
Method

WebListBox.Cell ( RowNumber As Integer, ColumnNumber As Integer ) As String

Used to read from or write to the cell based on the row and column numbers passed.

Notes

Row and Column are zero-based. The top-left cell is 0,0. Passing -1 as either the Row or Column number means all rows or all columns, respectively. For example, the following specifies all columns in the last row added using AddRow or InsertRow:

Me.Cell(Me.LastIndex, -1)

If you set this equal to a tab-delimited string, you can update the row with one line of code.


Examples

This code is in the SelectionChanged event. It gets the text of the row the user clicked on and writes it to a Label.

Label1.Text = Me.Cell(Me.ListIndex, 0)

This code in the CellClick event changes the value of the cell the user clicked.

Me.Cell(row, column) = "You clicked me"

The WebListBox example project in the Examples folder uses Cell to replace the contents of the selected row with the contents of two WebTextFields.

If PeopleList.ListIndex = -1 then
'The WebListBox.AddRow method allows you to pass multiple parameters
'to add values to other columns of the new row
PeopleList.AddRow(FirstNameField.Text, LastNameField.Text)
Else
PeopleList.Cell(PeopleList.ListIndex, 0) = FirstNameField.text
PeopleList.Cell(PeopleList.ListIndex, 1) = LastNameField.text
End If


Personal tools