|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add object to listviewHi!
sometime ago, a friend show me that in BC++ you could add an objet to each element of a listview. Now I wnat to know if it is possible to do this on VB.net 2005. I've a collection of objects and show some of their properties on the listview, if I could attach the object to each file of the listview it'll be easier. Thnaks. bye XiSco,
A ListView has items (no elements), that are special objects which can hold a lot of information. AFAIK can a listview not hold direct whatever object. http://msdn2.microsoft.com/en-us/library/system.windows.forms.listviewitem_members.aspx You can add to listviewitems again (detail) items (to show in detailview). I hope this helps, Cor Show quoteHide quote "XiScO" <sincor***@aqui.es> schreef in bericht news:uZq4egwrGHA.984@TK2MSFTNGP05.phx.gbl... > Hi! > sometime ago, a friend show me that in BC++ you could add an objet to each > element of a listview. Now I wnat to know if it is possible to do this on > VB.net 2005. > I've a collection of objects and show some of their properties on the > listview, if I could attach the object to each file of the listview it'll > be easier. > Thnaks. > bye Thanks for the reply. I don't understand exactly what you say (english is
not my native language). I want a listitem which conaints some string and an object (not shown). Particulary I add computers to the listview, so i show computer name, ip and mac. I create an object with this data, wich has public methods to make ping, wakeonlan, etc. So I want the object as a member of the the listview so when a click is done in one listview element I call the objet.method. Is clear what I want to do? Thanks again. Cor Ligthert [MVP] wrote: > XiSco, http://msdn2.microsoft.com/en-us/library/system.windows.forms.listviewitem_members.aspx> > A ListView has items (no elements), that are special objects which can > hold a lot of information. > AFAIK can a listview not hold direct whatever object. > > Show quoteHide quote > > You can add to listviewitems again (detail) items (to show in detailview). > > I hope this helps, > > Cor > > > > "XiScO" <sincor***@aqui.es> schreef in bericht > news:uZq4egwrGHA.984@TK2MSFTNGP05.phx.gbl... >> Hi! >> sometime ago, a friend show me that in BC++ you could add an objet to >> each element of a listview. Now I wnat to know if it is possible to do >> this on VB.net 2005. >> I've a collection of objects and show some of their properties on the >> listview, if I could attach the object to each file of the listview it'll >> be easier. >> Thnaks. >> bye Xisco,
Simple than, no that is impossible, Cor Show quoteHide quote "XiScO" <sincor***@aqui.es> schreef in bericht news:ebu393wrGHA.940@TK2MSFTNGP02.phx.gbl... > Thanks for the reply. I don't understand exactly what you say (english is > not my native language). > I want a listitem which conaints some string and an object (not shown). > Particulary I add computers to the listview, so i show computer name, ip > and mac. I create an object with this data, wich has public methods to > make > ping, wakeonlan, etc. > So I want the object as a member of the the listview so when a click is > done > in one listview element I call the objet.method. > Is clear what I want to do? > Thanks again. > Cor Ligthert [MVP] wrote: > >> XiSco, >> >> A ListView has items (no elements), that are special objects which can >> hold a lot of information. >> AFAIK can a listview not hold direct whatever object. >> >> > http://msdn2.microsoft.com/en-us/library/system.windows.forms.listviewitem_members.aspx >> >> You can add to listviewitems again (detail) items (to show in >> detailview). >> >> I hope this helps, >> >> Cor >> >> >> >> "XiScO" <sincor***@aqui.es> schreef in bericht >> news:uZq4egwrGHA.984@TK2MSFTNGP05.phx.gbl... >>> Hi! >>> sometime ago, a friend show me that in BC++ you could add an objet to >>> each element of a listview. Now I wnat to know if it is possible to do >>> this on VB.net 2005. >>> I've a collection of objects and show some of their properties on the >>> listview, if I could attach the object to each file of the listview >>> it'll >>> be easier. >>> Thnaks. >>> bye > Ok, thanks
Cor Ligthert [MVP] wrote: Show quoteHide quote > Xisco, http://msdn2.microsoft.com/en-us/library/system.windows.forms.listviewitem_members.aspx> > Simple than, no that is impossible, > > Cor > > "XiScO" <sincor***@aqui.es> schreef in bericht > news:ebu393wrGHA.940@TK2MSFTNGP02.phx.gbl... >> Thanks for the reply. I don't understand exactly what you say (english is >> not my native language). >> I want a listitem which conaints some string and an object (not shown). >> Particulary I add computers to the listview, so i show computer name, ip >> and mac. I create an object with this data, wich has public methods to >> make >> ping, wakeonlan, etc. >> So I want the object as a member of the the listview so when a click is >> done >> in one listview element I call the objet.method. >> Is clear what I want to do? >> Thanks again. >> Cor Ligthert [MVP] wrote: >> >>> XiSco, >>> >>> A ListView has items (no elements), that are special objects which can >>> hold a lot of information. >>> AFAIK can a listview not hold direct whatever object. >>> >>> >> Show quoteHide quote >>> >>> You can add to listviewitems again (detail) items (to show in >>> detailview). >>> >>> I hope this helps, >>> >>> Cor >>> >>> >>> >>> "XiScO" <sincor***@aqui.es> schreef in bericht >>> news:uZq4egwrGHA.984@TK2MSFTNGP05.phx.gbl... >>>> Hi! >>>> sometime ago, a friend show me that in BC++ you could add an objet to >>>> each element of a listview. Now I wnat to know if it is possible to do >>>> this on VB.net 2005. >>>> I've a collection of objects and show some of their properties on the >>>> listview, if I could attach the object to each file of the listview >>>> it'll >>>> be easier. >>>> Thnaks. >>>> bye >> You can use the ListViewItem.Tag property to store private data that should
be associated with a particular item /claes Show quoteHide quote "XiScO" <sincor***@aqui.es> wrote in message news:uZq4egwrGHA.984@TK2MSFTNGP05.phx.gbl... > Hi! > sometime ago, a friend show me that in BC++ you could add an objet to each > element of a listview. Now I wnat to know if it is possible to do this on > VB.net 2005. > I've a collection of objects and show some of their properties on the > listview, if I could attach the object to each file of the listview it'll > be easier. > Thnaks. > bye |
|||||||||||||||||||||||