Getting 2nd column value in listView

I have a listView item that contains 3 columns.  I've been able to set up the listView to show the values, but now I want to retrieve the 2nd column's value of the item the user selects.  I've tried using get(dbeMyListView, 1), but this gives me the 2nd item's 1st column value.  How do I get the string that is in the 2nd column of the item selected?  And if it is a multi-select listView, how would I do this for each selected item?

 

Chris


chrscote - Fri Dec 22 10:33:21 EST 2017

Re: Getting 2nd column value in listView
EHcnck - Tue Dec 26 09:32:47 EST 2017

getColumnValue
Declaration
string getColumnValue(DBE listView,
int row,
int column)
Operation
Returns the value of the item or subitem identified by row in column. Both row and column count from 0. This works
only for list views.
Example
This example returns the 34th row of the first column in list view main.
string s = getColumnValue(main, 33, 0)

Re: Getting 2nd column value in listView
chrscote - Tue Jan 02 07:47:26 EST 2018

EHcnck - Tue Dec 26 09:32:47 EST 2017

getColumnValue
Declaration
string getColumnValue(DBE listView,
int row,
int column)
Operation
Returns the value of the item or subitem identified by row in column. Both row and column count from 0. This works
only for list views.
Example
This example returns the 34th row of the first column in list view main.
string s = getColumnValue(main, 33, 0)

getColumnValue will work fine if I know which row was selected, but how do I determine the row.  If the user selects the 2nd, 4th and 5th items in a list, then the resulting list of items doesn't tell me what rows they were.

 

Chris

Re: Getting 2nd column value in listView
EHcnck - Wed Jan 03 21:39:48 EST 2018

chrscote - Tue Jan 02 07:47:26 EST 2018

getColumnValue will work fine if I know which row was selected, but how do I determine the row.  If the user selects the 2nd, 4th and 5th items in a list, then the resulting list of items doesn't tell me what rows they were.

 

Chris

selected(element)
Declaration
bool selected(DBE element, int index)
506
DXL Reference Manual
Operation
Returns true if the option or item identified