Invoke batcheditcommand

6 posts, 0 answers
  1. Rem
    Rem avatar
    12 posts
    Member since:
    Jan 2014

    Posted 28 Jan 2014 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Jan 2014 in reply to Rem Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 28 Jan 2014 Link to this post

    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.
  5. Mitch
    Mitch avatar
    9 posts
    Member since:
    Nov 2014

    Posted 17 Nov 2014 in reply to Konstantin Dikov Link to this post

    is that a no?
  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 17 Nov 2014 Link to this post

    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.

     
  7. Mitch
    Mitch avatar
    9 posts
    Member since:
    Nov 2014

    Posted 17 Nov 2014 in reply to Konstantin Dikov Link to this post

    right. that makes sense. I was more interested in the values than the function, but I guess that's not quite this question
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017