I am setting a combobox item like this:
List<Object> items = new List<Object>();
items.Add(new { Text = "MyVal", Value = 1 });
cbo.DataSource = items;
It then in VS returns:
But I cannot simply now say cbo.SelectedItem.Text or cbo.SelectedItem.Value. If i try this, I get the error
"object does not contain a definition for value and no extension method value
accepting a first argument of type object could be found"
How can I get the Value Property please
Aucun commentaire:
Enregistrer un commentaire