Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete Row from Many Side of Relationship
Message
From
06/08/2010 09:47:54
 
 
To
05/08/2010 11:33:14
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01475325
Message ID:
01475524
Views:
20
>Hi,
>
>MM.NET, C#, ASP.NET
>
>I have a form displaying a 1 to many relationship. The many side is displayed in a grid view and rows can be added/edited/deleted.
>
>Currently I have code like this, that will delete the row in the grid:
>
>
        protected void grdRiders_RowDeleting(object sender, GridViewDeleteEventArgs e)
>        {
>            DataSet dsPolicyRider = (DataSet)Session["dsPolicyRider"];
>            dsPolicyRider.Tables[0].Rows[e.RowIndex].Delete();
>            this.BindControl(this.grdRiders);
>        }
>
>When the row is deleted, it is removed from the display in the Grid View. However, when I then use the page's Save button, I get this error in VS2008:
>
>
Exception has been thrown by the target of an invocation.
>
>If I stop the application, this error then gets displayed in the browser:
>
>
Deleted row information cannot be accessed through the row.
>
>How does one delete rows from a grid successfully?
>
>< update >
>I just noticed that this error only occurs if I have two rows in the grid and I delete the first one. If I just have one row, or delete the last row, then it is fine.

Does anybody do this in MM.NET Web form applications? I see that the Jump Start has the same technique of deleting it from the BO, which causes it to get deleted completely, not giving the user the chance to cancel overall changes to the entire form.

This is getting very frustrating :(
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform