Bound WebCombo with Data Object as Value

1 reply. Last post: April 15, 2010 3:06 AM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
a aMember

Hi

I have a Webcombo that is bound to an ObjectDataSource which returns a collection of a dataset. for example of the type Person. Here's a snippet:

    public class Person
{
private Guid personId;
private string lastname;

[DataMember]
public Guid Id
{
get { return personId; }
protected set { personId = value; }

[DataMember]
public string Lastname
{
get { return lastname; }
set { lastname = value; }
}

}

The ObjectDataSource retrieves a list of Persons with a WCF-Service:

public IList<Person> GetPersons();


When I bind a WebCombo to the DataSource I can select the Display Member (Property Lastname in my case) and the Value Member, which can be retrieved with myWebCombo.Text and myWebCombo.Value. For these I can only chose from the properties of my Data Objects (Lastname and Id) but I want the Value to be the data object itself (i.e the Person instance). Is this possible?

If not, is it anyhow possible to get the bound data object over myWebCombo.<GetTheBoundDataObject>?

Thanks

All times are GMT -5. The time now is 5:43 PM.
Previous Next