The lParam functions have a parameter for zero based column number. Should there be a separate lParam for each column or is the lParam per Item only?
As far as I can tell, the lParam stored using the FF_ListView_InsertItem function is the only one I can read later using the FF_ListView_GetItemlParam function regardless of the column number.
Code Used to Create 1st (0th) Item:
%lvColBName = 0
%lvColInName = 1
FF_ListView_InsertItem( hWND_FORM2_LISTVIEW1, 0, %lvColBName, "BindingName", 100, 0 )
FF_ListView_SetItemText( hWND_FORM2_LISTVIEW1, 0, %lvColInName, "Input Name" )
FF_ListView_SetItemlParam( hWND_FORM2_LISTVIEW1, 0, %lvColInName, 200 )
FF_ListView_SetItemText( hWND_FORM2_LISTVIEW1, 0, %lvColOutName, "Output Name" )
FF_ListView_SetItemlParam( hWND_FORM2_LISTVIEW1, 0, %lvColOutName, 300 )
Code Used to Read Item 0:
ItemId = FF_ListView_GetItemlParam( hWND_FORM2_LISTVIEW1, 0, %lvColInName)
'ItemID returns the value 100 instead of the value 200 as I expect.
ItemId = FF_ListView_GetItemlParam( hWND_FORM2_LISTVIEW1, 0, %lvColOutName)
'ItemID returns the value 100 instead of the value 300 as I expect.
Thanks,
Peter House
Hi Peter,
Yes, you are right. It is per item only rather than column based. I know that this was raised before on the forum and I searched MSN and found a reference to it being per item rather than per column. I imagine that when I first wrote the function that I was under the impression that it would work on a per column basis. See, everyone makes mistakes! :D
Dagnabbit!!!
The function call totally mislead me. I was hoping to use the lParams to hold IDs for database linking instead of using the text for lookup since the text could be duplicated and does not provide a unique link.
My fallback position will be to use a UDT array and let the listview reflect the values in the array. Fallback #2 is to get the Listview Row data from the database each time the Listview is clicked. I think I like Fallback #2 better since it is "closer" to the data.
Any other ideas are welcome.
Thanks,
Peter
I once thought I made a mistake . . .