I have a RadGrid in which I associated EditBatchCommand event.
In this event , I must do insert/update/delete.
I have 2 buttons in my RadGrid page, insert button and update button, insert button will add new row and update button will update all changes.
I have associated client events as follows to these buttons,
if (UpdateButton.Visible)
{
script = @"function SaveChanges_" + grid.ClientID + @"(sender,args) {
var grid = $find('" + grid.ClientID + @"');
var changes = grid.get_batchEditingManager()._extractChangesString(grid.get_masterTableView())
if(changes.length > 0)
grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
}";
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "saveGrid", script, true); UpdateButton.AutoPostBack = false;
UpdateButton.OnClientClicked = "SaveChanges_" + grid.ClientID;
this.Page.Form.DefaultButton = UpdateButton.UniqueID; }
if (InsertButton.Visible)
{
script = @"function InsertRow_" + grid.ClientID + @"(sender,args) {
var grid = $find('" + grid.ClientID + @"');
grid.get_batchEditingManager().addNewRecord(grid.get_masterTableView());
}";
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "insertRow", script, true);
InsertButton.AutoPostBack = false;
InsertButton.OnClientClicked = "InsertRow_" + grid.ClientID;
}
I have updated 1 line in my grid.
In my event "BatchEditCommand", I am having 1 commands with type "update" and I am able to get values with command.NewValues.
But when I insert a line in my grid.
In my event "BatchEditCommand", I am not getting type "insert". I am having only one command with type "update" with command.NewValues = null.
I am having this problem only after updating to new version Q3 2014. The old version of Telerik worked well and I had a command of type "insert" and I was able to get the data of newly added row with command.NewValues.
How can get the datas of my newly added row?
Thanks in advance.
In this event , I must do insert/update/delete.
I have 2 buttons in my RadGrid page, insert button and update button, insert button will add new row and update button will update all changes.
I have associated client events as follows to these buttons,
if (UpdateButton.Visible)
{
script = @"function SaveChanges_" + grid.ClientID + @"(sender,args) {
var grid = $find('" + grid.ClientID + @"');
var changes = grid.get_batchEditingManager()._extractChangesString(grid.get_masterTableView())
if(changes.length > 0)
grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
}";
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "saveGrid", script, true); UpdateButton.AutoPostBack = false;
UpdateButton.OnClientClicked = "SaveChanges_" + grid.ClientID;
this.Page.Form.DefaultButton = UpdateButton.UniqueID; }
if (InsertButton.Visible)
{
script = @"function InsertRow_" + grid.ClientID + @"(sender,args) {
var grid = $find('" + grid.ClientID + @"');
grid.get_batchEditingManager().addNewRecord(grid.get_masterTableView());
}";
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "insertRow", script, true);
InsertButton.AutoPostBack = false;
InsertButton.OnClientClicked = "InsertRow_" + grid.ClientID;
}
I have updated 1 line in my grid.
In my event "BatchEditCommand", I am having 1 commands with type "update" and I am able to get values with command.NewValues.
But when I insert a line in my grid.
In my event "BatchEditCommand", I am not getting type "insert". I am having only one command with type "update" with command.NewValues = null.
I am having this problem only after updating to new version Q3 2014. The old version of Telerik worked well and I had a command of type "insert" and I was able to get the data of newly added row with command.NewValues.
How can get the datas of my newly added row?
Thanks in advance.