Re: Win32Lib ListView + setUserProperty query
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 11, 2005
- 494 views
Dave Probert wrote: [snip] > Sorry but the full code is waaaay to big to post here, but > here's the lines that fill the listview: > > -- loclv is the ListView > -- data is a sequence of values for a row > -- ids is a matching sequence containing the DB row id's > > eraseItems(loclv) > tmph = 0 > for i=length(data) to 1 by -1 do > id = addLVItem(loclv,tmph,data[i]) -- add row at a time > if i<= length(ids) then > setUserProperty(id,"identifier",ids[i]) > end if > end for > The 'id' in the setUserProperty() call is meant to be a CONTROL and not the value returned by addLVItem(). It is designed to add a property to a control. Another method you might like to look at instead is ...
eraseItems(loclv) tmph = 0 for i=length(data) to 1 by -1 do id = addLVItem(loclv,tmph,data[i]) -- add row at a time if i<= length(ids) then setUserProperty(loclv,id&"identifier",ids[i]) end if end for
And then to retrieve the hidden data for a particular id ...
sequence temp sequence hidden temp = getUserProperty(loclv, id&"identifier") if length(temp) > 0 then hidden = temp[1] else hidden = {} end if
> > PS. Derek - looking forward to the next win32lib :) Me too. -- Derek Parnell Melbourne, Australia irc://irc.sorcery.net:9000/euphoria