Get ValueMembers from a Databound Multiselect ListBox

Can any one help me

I m using the binding the DataSet with ListBox with ValueMember Now all I need is to get the ValueMembers for Multi selected items in the list box.

How can i get the value of ValueMember for Each Selected Item




Answer this question

Get ValueMembers from a Databound Multiselect ListBox

  • duncan849

    Can you Please give an example

  • Mihai

    If anyone from the .NET development team is seeing this, I would suggest having a SelectedValues property that mirrors the SelectedItems property using the ValueMember.

  • arganx

    instead of "name" use the Value Member string name in ur code.

  • PhilPorreca

    use the following code to get the Selected data:

    for(int i=0;i<=listBox1.SelectedItems.Count-1;i++)

    {

    DataRowView ln = (DataRowView) listBox1.SelectedItemsIdea;

    MessageBox.Show(ln["name"].ToString());

    }



  • HannibalCannibal

    Thanks

  • Get ValueMembers from a Databound Multiselect ListBox