RadGrid within DataForm

3 posts, 0 answers
  1. Mark
    Mark avatar
    16 posts
    Member since:
    Jul 2015

    Posted 18 May 2016 Link to this post


    I have a Radgrid within a dataform. When the user click edit on the Dataform I can get the Radgrid to display in Batch edit mode.

    But on pressing the Update button on the Dataform, how do I get the values of the edited grid in code behind.

    I already use the _ItemUpdating event for the Dataform, and thought I would be able to see the values of the edited grid with EditItems

    But it seems not.

    Many Thanks for any help


  2. Mark
    Mark avatar
    16 posts
    Member since:
    Jul 2015

    Posted 19 May 2016 in reply to Mark Link to this post

    In a very roundabout way I have managed to get it to work.

    The RadGrid is sitting in the EditItemTemplate of a RadDataForm. And when the page displays the RadGrid is in Batch Edit mode  <MasterTableView EditMode="Batch" ></MasterTableView>

    Ideally I would like to extract all the values of the RadGrid when the user clicks the RadDataForm Update button within the RadDataForm_ItemUpdating event.
    But this doesn’t seem possible.
    So I have used OnClientClicked=" SaveSeasonCosts " on the RadDataForm Update button, this calls a javascript function to mimic the update of the grid.

    Function SaveSeasonCosts(Sender, args) {

      var id = Sender.get_element().id;
    var GetGridClientID = $get(id).getAttribute("GID");

    var grid = $find(GetGridClientID);


    Which in turn fires the _BatchEditCommand event of the RadGrid where I can get to the values.

    So is this the way to do this? Other than javascript is there no other way to invoke an update of the grid when the RadDataForm updates?

    Many Thanks

  3. Eyup
    Eyup avatar
    4045 posts

    Posted 23 May 2016 Link to this post

    Hello Mark,

    Yes, you are correct. Essentially, Batch editing mode is different than other modes. You can find a detailed explanation in the following section:

    You need to use the Batch client-side API to execute your logic:

    For using an external button to save the records, you can check the following post:

    The crucial key requirement here is that the postback should be initiated by the Batch client-side API commands. I hope the clarification was helpful.

Back to Top