This is a migrated thread and some comments may be shown as answers.

BatchEditCommand server side - exception logic

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KIM
Top achievements
Rank 1
KIM asked on 09 Oct 2014, 02:30 PM
Hi,
My case, radgrid disappeared after BatchEditCommand logic
I want to know BatchEditCommand Exception logic
When DB is Exception, my solution is not New rebind, but user's Modified data

Thank you~!

protected void RadGrid1_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
{    
     foreach (GridBatchEditingCommand command in e.Commands)    
     {        
          Hashtable newValues = command.NewValues;        
          Hashtable oldValues = command.OldValues;        

          // Oracle DB Insert/Update/Delete...

          If(DB Exception)
          {
              // Rollback();
              return; //  Grid disppeard 
          }
     }

     //Commit(); // even in that case, Grid disappear
}

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 14 Oct 2014, 10:56 AM
Hi Kim,

The BatchEdiCommand enables you to review the commands that are executed for the RadGrid. You could use the handler of the event to perform additional validation of the data prior to saving it. 

If you would like to inform the user of a database error you can use the ItemInserted and ItemUpdated events.

With this said, the grid disappearing seems rather strange. Would you provide your full markup with the related code-behind? This will enable us to try and replicate the behavior you are seeing locally and investigate the issue.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
KIM
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or