Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Navigate Enity by GridView
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01169653
Message ID:
01170813
Views:
8
Kevin,

For some reason the below does NOT set/change the data row:

this.oSurveyDue.Entity.SetDataRow(CurrentRow);

But this does:
this.oSurveyDue.DataRow = CurrentRow;

What might I be doing wrong or different?

Thanks, Ted

>Ted,
>
>>How do I return the edited DataRow of a GridView then use that datarow to navigate to the entity row for a webform?
>
>In the RowUpdating event handler method, the EditIndex value specifies the DataRow in the DataTable that is being updated. You can do something like this:
>
>
protected void grdSurveyDue_RowUpdating(object sender, GridViewUpdateEventArgs e)
>{
>
>        // Get the item to be updated
>        this.grdSurveyDue.EditIndex = e.RowIndex;
>        // Retrieve the previous SurveyDue DataSet
>        DataSet dsSurveyDue = (DataSet)Session["dsSurveyDue"];
>        // Get the DataRow
>        DataRow CurrentRow = dsSurveyDue.Tables["MyTableName"].Rows[e.RowIndex];
>
>        // Use the below to set the entity data row
>        this.oSurveyDue.Entity.SetDataRow(CurrentRow);
>
>        // NOTE: Put code in here to check and manipulate the data
>
>         // Save the DataSet (the GridView automatically binds back)
>        this.Save(this.oSurveyDue, dsSurveyDue);
>
>        // Reset the edited item and rebind the GridView
>        this.grdSurveyDue.EditIndex = -1;
>        this.BindControl(this.grdSurveyDue);
>}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform