Skip to content

Get values from multi column list view

New Discussion
Brian
Brian asked on Apr 19, 2011 5:00 PM

Good morning,

I have a control showing as a SwfListView in our application.  The list has 2 columns.  I can get the item count with the code below and the value of the first column. How do I get the associated value in the 2nd column?

'Build the output sheet to see what we have for values
sheetNameOutputData = "Output Data"
DataTable.AddSheet(sheetNameOutputData)
Set DTOuptputData = DataTable.GetSheet(sheetNameOutputData)

'Create the columns
columnName = "Value"
EmpltyData = ""
EmptyData = DTOuptputData.AddParameter(columnName, "").Name

var_GetItemsCount = SwfWindow("Summit FT Diagnostics").SwfListView("environmentListView").GetItemsCount()
For loopItems = 1 to var_GetItemsCount
 'Set the output row
 DTOuptputData.SetCurrentRow(loopItems)
 strItemValue = SwfWindow("Summit FT Diagnostics").SwfListView("environmentListView").GetItem(loopItems – 1) 'Subtract 1 since index starts with zero
 'Output the data
 DTOuptputData.GetParameter(columnName).Value = strItemValue
Next

'Header in the object show 2 columns
var_GetColumnHeader = SwfWindow("Summit FT Diagnostics").SwfListView("environmentListView").GetColumnHeader(1)

Regards,

Brian Washburn

 

Sign In to post a reply

Replies

  • 0
    Michael Germann
    Michael Germann answered on Apr 19, 2011 5:00 PM

    There are two possibilities. You can use GetColumnContent(sColName or iColIndex), which will get you all the values for that particular column.

    Or you can use GetNAProperty(sPropertyPath)

    Something like the following:

    Set ListView = SwfWindow("Form1").SwfListView("ultraListView1")
    msgbox ListView.GetNAProperty("Items[1].SubItems[0].Text")

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Brian
Favorites
0
Replies
1
Created On
Apr 19, 2011
Last Post
14 years, 10 months ago

Suggested Discussions

Tags

Created by

Created on

Apr 19, 2011 5:00 PM

Last activity on

Apr 19, 2011 5:00 PM