|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Listview item keyAssuming lv.items.add(key,text, image index)
In a listview with items and subitems in each row, how do we get the key value of the selected row? The examples I see check for selectedindices it seems. In VB6 I used a API method but surely in .Net there's such a inbuilt method? Thanks, Adam Hi Adam,
Try with the ListViewItem.Name property for the selected items. -- Show quoteHide quoteBest regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio You can code, design and document much faster: http://www.mztools.com "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> escribió en el mensaje news:uguWRO1YGHA.1016@TK2MSFTNGP03.phx.gbl... > Assuming lv.items.add(key,text, image index) > > In a listview with items and subitems in each row, how do we > get the key value of the selected row? > > The examples I see check for selectedindices it seems. In > VB6 I used a API method but surely in .Net there's such a > inbuilt method? > > Thanks, > Adam > Under which LV event would this go?
Isn't it better to use the key rather than the name of the 1st column's displayed text? I need to link the LV to then allow some code that deletes an entry in an INI file corresponding to the name of the LV item key. Adam Show quoteHide quote "Carlos J. Quintero [VB MVP]" <carlosq@NOSPAMsogecable.com> wrote in message news:OChRh64YGHA.4920@TK2MSFTNGP02.phx.gbl... > Hi Adam, > > Try with the ListViewItem.Name property for the selected items. > > -- > > Best regards, > > Carlos J. Quintero > > MZ-Tools: Productivity add-ins for Visual Studio > You can code, design and document much faster: > http://www.mztools.com > > > "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> escribió en el > mensaje news:uguWRO1YGHA.1016@TK2MSFTNGP03.phx.gbl... >> Assuming lv.items.add(key,text, image index) >> >> In a listview with items and subitems in each row, how do we >> get the key value of the selected row? >> >> The examples I see check for selectedindices it seems. In >> VB6 I used a API method but surely in .Net there's such a >> inbuilt method? >> >> Thanks, >> Adam >> > > Hi Adam,
ListViewItem.Name returns the key that you used in the call ListView1.Items.Add(key, text,....) There is some incoherence because sometimes it is called Key, and sometimes name. Do not confuse it with the text. -- Show quoteHide quoteBest regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio You can code, design and document much faster: http://www.mztools.com "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> escribió en el mensaje news:O6DYJxAZGHA.1200@TK2MSFTNGP03.phx.gbl... > Under which LV event would this go? > > Isn't it better to use the key rather than the name of the 1st column's > displayed text? > > I need to link the LV to then allow some code that deletes an entry in an > INI file corresponding to the name of the LV item key. > > Adam
Listview SubItems image index
Emailing with default client Regular Expression Help...Line Break Writing INI section failing 1.1 and 2.0 .Net framework in same application? Is it possible to compile an image file into a DLL or EXE file? Dynamically reading structure fields Two way collection Desktop integrated file browser Limits of the datagrid |
|||||||||||||||||||||||