Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Problem with Batch Update and Activation
posted

I tried to implement batch update (AutoCRUD=false) with activation, but my implementation works for normal update but I got a problem when edit the same row for TWICE.

protected void WebDataGrid1_RowUpdating(object sender, RowUpdatingEventArgs e)
{

    //Add rows with new values to temp datset
    dstTemp.Tables[0].AddRow.....

    //to prevent show old values after editing
    e.Cancel = true;
}

protected void SaveButton_Click(object sender, EventArgs e)
{
    SqlDataSource1.Update();
}

protected void SqlDataSource1_Updating(object sender, SqlDataSourceStatusEventArgs e)
{
    //update temp dataset to DB
}

Steps:
1. Edit field A of first row.
2. Edit field A of second row.
3. Edit field B of first row.
4. Click Save Button.

RowUpdating fires twice after Save Button is clicked. But I just can get field B's new value of first row, e.Values["FIELD_A"] only gives old value. Please help!