[RESOLVED] Populate unbound Combobox w. Valuemember
Hi all, I've been away for a while from VB6 and just beginning with VB.NET 2008.
What I'm just trying to do is the following:
I need to fill a combobox from a dataset, but I have to translate the entries before displaying them. That's why I assume I have to use a loop to add the Items.
Yet if I simply use "comboBox.Items.Add()" then I can't set something like a ValueMember to store the ID.
Any ideas how to accomplish this?
Re: Populate unbound Combobox w. Valuemember
Just do a loop and interact with all datarow's in the datatable that you want to change, after this just set the combo box datasource to the datatable, and set the value member and the display member...
vb.net Code:
For Each r As DataRow In DataTable1.rows
r("col1") = "NewValue"
r("col2") = "NewValue"
Next
Re: Populate unbound Combobox w. Valuemember
Thanks, mickey!
How easy can it get? I got stuck into some complicated idea and did not think about that approach!