I have a databound combobox and I need to get all of the ValueMember values from each item in the combobox. I'd prefer to not change the selected item in the combobox to do this, since each time the item in the combobox changes a few events are triggered that wouldn't need to be.

Is there a way to just get the array of ValueMembers without a loop?

I have a databound combobox and I need to get all of the ValueMember values from each item in the combobox. I'd prefer to not change the selected item in the combobox to do this, since each time the item in the combobox changes a few events are triggered that wouldn't need to be.

Is there a way to just get the array of ValueMembers without a loop?

Nevermind, unless someone has a better solution, this seems to work:

foreach (DataRowView x in theDataBindingSource.List)
            {
                int xx = (int)x["MyValueMemberColumn"];
                // Do Stuff...
            }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.