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

Invoke batcheditcommand

5 Answers 548 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rem
Top achievements
Rank 1
Rem asked on 28 Jan 2014, 06:07 AM
Hi,

Is it possible to invoke radgrid batcheditcommand from code behind.

I saw a mthod to call it from javascript but i want to do it in Vb.net

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Jan 2014, 08:09 AM
Hi Rem,

I guess you want to do operations from code behind for Batch edit. You can use the OnBatchEditCommand event of the Radgrid.

VB:
Protected Sub RadGrid1_BatchEditCommand(sender As Object, e As GridBatchEditingEventArgs)
    For Each command As GridBatchEditingCommand In e.Commands
        If (command.Type = GridBatchEditingCommandType.Update) Then
            Dim newValues As Hashtable = command.NewValues
            Dim oldValues As Hashtable = command.OldValues 
            Dim ID As String = newValues("ID").ToString()
            ' Code to Update
        End If
    Next
End Sub
 
Thanks,
Princy
0
Konstantin Dikov
Telerik team
answered on 28 Jan 2014, 08:09 PM
Hi Rem,

Batch editing is client-side oriented edit mode and the server-side BatchEditCommand event will fire only if any of the following client-side function are called from the RadGrid batchEditingManager (and there are changes within the grid): saveChanges(tableView), saveAllChanges() or saveTableChanges(tableViews).

Detailed information about Batch editing is available at the following online help article:

Hope that helps.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Mitch
Top achievements
Rank 1
answered on 17 Nov 2014, 04:28 PM
is that a no?
0
Konstantin Dikov
Telerik team
answered on 17 Nov 2014, 04:53 PM
Hello Mitch,

Yes, you cannot invoke the BatchEditCommand from the code-behind and I must say that there is no reason for doing so, because in order to pass some values from client-side you will have to use one of the approaches that I have mentioned in my previous post. If you have a postback initiated in some other manner, no changes will be passed to server-side.

Additionally, If you need to perform some CRUD operations, separately from the user's input, you do not need the BatchEditCommand to be fired to perform manual updates to your data source.


Regards,
Konstantin Dikov
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.

 
0
Mitch
Top achievements
Rank 1
answered on 17 Nov 2014, 05:23 PM
right. that makes sense. I was more interested in the values than the function, but I guess that's not quite this question
Tags
Grid
Asked by
Rem
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Konstantin Dikov
Telerik team
Mitch
Top achievements
Rank 1
Share this question
or