Update Problem when using BatchUpdate method

2 replies. Last post: August 30, 2011 2:09 AM by xu guochun
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
xu guochunMember

Hi ,

    I meet a problem when using BatchUpdate method to update data of webgrid . It is a alert said "Unable to find the record in the datasource" . However ,  the data in the webgrid is updated and the data in the database is also updated . It means update success .

    I do not know why was that . The following code is key code about BatchUpdate method .

 protected void WG1_BatchUpdate(object sender, BatchUpdateEventArgs e)
 {
       string TypeGuid="";
       foreach (WebGridRowChanges rowChanges in e.PendingChanges)
       {
            if (rowChanges.RowState == RowState.Modified)
            {
                 TypeGuid = rowChanges.KeyValue.ToString();
                 UpdateHandleType(rowChanges.Data, TypeGuid);
            }
       }

        WG1.ClientAction.InvokeScript("alert('Update Success!');ISGetObject('" + WG1.ClientID + "').Refresh();");
}

  private CommonDataRow UpdateHandleType(List<WebGridCellData> data, string typeGuid)
{
      CommonDataRow row = new CommonDataRow("Frame_WaitHandleTypes", "TypeGuid", typeGuid, "Frame_ConnectionString");
      foreach (WebGridCellData cellData in data)
      {
         row[cellData.Column.DataMember] = cellData.NewValue;
      }
       row.Update();
       return row;
}

  The image in the attach file is that alert .

   Anyone can help me ? Thanks a lot !

1 attachment
All times are GMT -5. The time now is 2:47 AM.
Previous Next