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

Demo for muti-row client-side programmatic edit?

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John Hutchinson
Top achievements
Rank 1
John Hutchinson asked on 08 Jun 2011, 03:50 AM
Hi guys, I've been pouring over the demos looking for a solution to a scenario i'm facing, and I'm starting to get a little bug-eyed so I thought I would throw it out there...

I have a radgrid with rows that contain a location, a quantity, and a dollar amount like this:

  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc

I have a radwindow pop-up that 'sits on top' of this radgrid (actually a separate aspx). The popup allows them to enter a value that will be used to adjust the amount for all rows matching a given quantity. So if I pick qty 1 and adjust by .1 (up), i want to programmatically and automatically update the data for the matching rows in the grid. regardless of the value of location. In this case the data would look like this after the update:

  • location X, qty 1, amount $1.1 (updated +.1)
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.11 (updated +.1)
  • location Y, qty 2, amount $1.17

I have the radwindow passing back the necessary values and I'm trying to plug through the JavaScript necessary to programmatically  1) loop through and find the rows with the matching quantity (it's a key field), 2) edit them with a new amount, 3) post the update.Sort of an automatic batch update.

Is there a demo on this scenario out there? I'm sure I'm missing it.

Thanks!

  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc
  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc
  • 1 Answer, 1 is accepted

    Sort by
    0
    Marin
    Telerik team
    answered on 13 Jun 2011, 09:28 AM
    Hi John,

     You can check out the client-side API for the grid which contains many useful methods for iterating (get_dataItems()), editing ( editItem() ) and updating (udpateItem() ) items. Similar demos for batch update and window editing can be found here:
    Batch update
    Window editing

    All the best,
    Marin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Tags
    Grid
    Asked by
    John Hutchinson
    Top achievements
    Rank 1
    Answers by
    Marin
    Telerik team
    Share this question
    or