G
Guest
I am using the following code as an example. Once the user selects an
item from the combobox (e.g., "Martin"), how can I access the value of
that item (e.g., "1")?
Dim dtAdjuster as new DataTable
dtAdjuster.Columns.add("Names")
dtAdjuster.Columns.add("Keys")
dtAdjuster.loaddatarow(new object() {"Martin", "1"},true)
dtAdjuster.loaddatarow(new object() {"Cor","2"},true)
Combobox1.datasource = dt
Combobox1.displaymember = "Names"
Combobox1.Valuemember = "Keys"
In the click method, I check the value of
Combobox1.SelectedValue.ToString
It is returning "System.Data.DataRowView" as the value of the
item. What is wrong? Any idea?
Thank you in advance.
item from the combobox (e.g., "Martin"), how can I access the value of
that item (e.g., "1")?
Dim dtAdjuster as new DataTable
dtAdjuster.Columns.add("Names")
dtAdjuster.Columns.add("Keys")
dtAdjuster.loaddatarow(new object() {"Martin", "1"},true)
dtAdjuster.loaddatarow(new object() {"Cor","2"},true)
Combobox1.datasource = dt
Combobox1.displaymember = "Names"
Combobox1.Valuemember = "Keys"
In the click method, I check the value of
Combobox1.SelectedValue.ToString
It is returning "System.Data.DataRowView" as the value of the
item. What is wrong? Any idea?
Thank you in advance.