My list view is populated initially thanks to the forum. I need to be able to select the the first line in the list view now and return the data so I know the SiteListNum. The examples for the listbox on the forum don't seem to work correctly for me with list view. Can anyone provide an example? My code is below:
*>PopulateListbox method
method-id PopulateListbox final private.
local-storage section.
01 SiteList.
05 SiteListDesc pic x(40) value spaces.
05 SiteListNum pic x(4) value spaces.
01 indexOfSelection binary-long value 0.
01 row type ListViewItem.
procedure division.
if ds-return = spaces
invoke listView1::BeginUpdate
perform varying idx from 1 by 1 until idx > 99
if lb-siteentry(idx) > spaces
set row to new ListViewItem(LB-SITEENTRY-DESC(idx))
invoke row::SubItems::Add(LB-SITEENTRY-NUM(idx))
invoke listView1::Items::Add(row)
else
exit perform
end-if
end-perform
*> set the selected listbox item to first line
move 0 to indexOfSelection
*> get the selected listbox item
invoke listView1::EndUpdate
end-if
end method.
*>end PopulateListbox method
#ListView
#VisualCOBOL
#SubItems
#VisualStudio










