Click here to Skip to main content
15,890,185 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieving multiple items from listview Pin
mrithula87-Apr-09 18:35
mrithula87-Apr-09 18:35 
GeneralRe: Retrieving multiple items from listview Pin
King Julien7-Apr-09 19:56
King Julien7-Apr-09 19:56 
GeneralRe: Retrieving multiple items from listview [modified] Pin
mrithula87-Apr-09 20:10
mrithula87-Apr-09 20:10 
GeneralRe: Retrieving multiple items from listview Pin
King Julien7-Apr-09 20:21
King Julien7-Apr-09 20:21 
GeneralRe: Retrieving multiple items from listview Pin
mrithula87-Apr-09 20:50
mrithula87-Apr-09 20:50 
GeneralRe: Retrieving multiple items from listview Pin
King Julien7-Apr-09 20:58
King Julien7-Apr-09 20:58 
GeneralRe: Retrieving multiple items from listview [modified] Pin
mrithula87-Apr-09 21:05
mrithula87-Apr-09 21:05 
GeneralRe: Retrieving multiple items from listview Pin
King Julien7-Apr-09 23:32
King Julien7-Apr-09 23:32 
Declare a label control array in the Form class like this

public Label[] lblArray = null; 
static int counter = 0;


Inside the form load method add your labels like this.....

this.lblArray = new Label[] { label4, label5, label6 };


Then the event should look like this...

private void ListView1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection sl = ListView1.SelectedItems;
           
            for (int h = 0; h < sl.Count; h++)
            {
                if (counter < lblArray.Length)
                {
                    lblArray[counter].Text = sl[h].Text;
                    counter++;
                }
            }
        }



I have even checked this myself... Its working for me... without any problem...

Have a Happy Coding.....

GeneralRe: Retrieving multiple items from listview Pin
mrithula88-Apr-09 0:04
mrithula88-Apr-09 0:04 
GeneralRe: Retrieving multiple items from listview Pin
King Julien8-Apr-09 0:12
King Julien8-Apr-09 0:12 
GeneralRe: Retrieving multiple items from listview Pin
mrithula88-Apr-09 1:12
mrithula88-Apr-09 1:12 
GeneralRe: Retrieving multiple items from listview Pin
King Julien8-Apr-09 1:14
King Julien8-Apr-09 1:14 
GeneralRe: Retrieving multiple items from listview Pin
mrithula88-Apr-09 1:30
mrithula88-Apr-09 1:30 
GeneralRe: Retrieving multiple items from listview Pin
King Julien8-Apr-09 2:45
King Julien8-Apr-09 2:45 
QuestionHow append css in html at run time Pin
sushilabhanvar3-Apr-09 1:21
sushilabhanvar3-Apr-09 1:21 
AnswerRe: How append css in html at run time Pin
Rajdeep.NET is BACK3-Apr-09 1:42
Rajdeep.NET is BACK3-Apr-09 1:42 
QuestionInstall setup only on one PC Pin
sjs4u3-Apr-09 1:00
sjs4u3-Apr-09 1:00 
AnswerRe: Install setup only on one PC Pin
King Julien3-Apr-09 1:14
King Julien3-Apr-09 1:14 
AnswerRe: Install setup only on one PC Pin
Rajdeep.NET is BACK3-Apr-09 1:38
Rajdeep.NET is BACK3-Apr-09 1:38 
GeneralRe: Install setup only on one PC Pin
sjs4u3-Apr-09 1:42
sjs4u3-Apr-09 1:42 
GeneralRe: Install setup only on one PC Pin
Rajdeep.NET is BACK3-Apr-09 1:46
Rajdeep.NET is BACK3-Apr-09 1:46 
QuestionHow to Read data of a file from application setup in c#.net windows Application Pin
Narendra Reddy Vajrala3-Apr-09 0:39
Narendra Reddy Vajrala3-Apr-09 0:39 
RantRe: How to Read data of a file from application setup Pin
musefan3-Apr-09 0:44
musefan3-Apr-09 0:44 
RantRe: How to Read data of a file from application setup Pin
Narendra Reddy Vajrala3-Apr-09 1:02
Narendra Reddy Vajrala3-Apr-09 1:02 
GeneralRe: How to Read data of a file from application setup Pin
musefan3-Apr-09 1:05
musefan3-Apr-09 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.