Bind list from FormView to model in ASP.net webforms
- by Monty
For a large fillin form I use the asp.net FormView for the magic databinding to my model. In this model I've a property called Rides (shown below), which exposes a list, which I obviously not want to be replaced entirely. So I made it readonly.
However, this way I can't use the databinding features anymore. Is there a common solution for this problem?
public IList<Ride> Rides
{
get
{
if (this._rides == null)
{
this._rides = new List<Ride>();
}
return this._rides;
}
}