C# – Get Selected Values from MultiSelect ListBox

How to iterate MultiSelect ListBox using C# (.NET)

Here is a way of retrieving the selected values of Multiselect listbox

  1. for (int i1 = 0; i1 < listBox1.SelectedItems.Count; i1++)
  2. {
  3. DataRowView D1 = listBox1.SelectedItems[i1] as DataRowView;
  4. MessageBox.Show(D1[1].ToString());
  5. }
for (int i1 = 0; i1 < listBox1.SelectedItems.Count; i1++)
            {
                DataRowView D1 = listBox1.SelectedItems[i1] as DataRowView;

                MessageBox.Show(D1[1].ToString());
            }

The above code uses SelectedItems collection to retrieve information Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl // StumbleUpon

Posted by Shasur at 12:34 AM
Labels: , ,
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.