Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Get values from multi column list view
posted

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

 

Parents
No Data
Reply
  • 7695
    Offline posted

    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")

Children
No Data