I'm retrofitting an ASP.NET application to the framwork. I'm trying to write some code so the user can add a record. If the user comes into the form in add mode (myform.aspx?AddNew=true) it works fine. If the user is in the form editing an existing record, then trys to add a new record, it crashes.
In my add routine I use GetEmptyDataSet then add a NewRow.
DataSet dsProject = this.boProject.GetEmptyDataSet();
this.boProject.NewRow();
When the form loads in add mode the GetEmptyDataSet call goes fine because in the CallStateChange method StateChange property is null. On the postback the property is set to "Retrieved" and the two-way bound controls on the page try to load throwing the exception "There is no row at position 0."
I'm loading a new bizobj into this.boProject every time the page loads whether it's a postback or not.
this.boProject = (Project)this.RegisterPrimaryBizObj(new Project());
Rip Ryness
International Falls, MN