I’m looking for a less complex mechanism for building a string based on the column contents of a listbox row. In digging through the OLR, I discovered that Listbox.List should return the entire row as a string including all column contents for that row. Unfortunately, the OLR page doesn’t really go into any details on how the resulting string should be assembled.
When I tried a quick test, all I got was the contents of column 0 when there are 18 columns with data.
Well, it has always been this way.
But looping over the columns to get the contents, assemble them into an array and return the resulting string them via join should be very fast, or am I overlooking something?
Loop over the columns of the row to assemble a string representation. This is hardly a “complex mechanism”. An example:
Dim values() As String
For columnIndex As Integer = 0 To lbx.ColumnCount - 1
values.Append(lbx.Cell(rowIndex, columnIndex))
Next
Dim s As String = Join(values, ";")