5 Replies Latest reply on Mar 26, 2007 11:04 AM by bmont

    updating datagrid values to database

    sreekar81
      HI,

      Please tell me, how to send the edited values of the datagrid to the database using httpservice...

      thanks in advance
        • 2. updating datagrid values to database
          sreekar81 Level 1
          ok Michael.... Suppose I have 3 columns in datagrid.. Now one user can enter 2 rows and another user can enter 3 rows... Now, I have to send these values through httpservice to .net application... So, How to give it in xml format??? I want the syntax for that?
          • 3. Re: updating datagrid values to database
            oscar7878 Level 1

            Of course your datagrid must have editable=true. When the user update a field you can call an event like "itemEditEnd" to call a function that select the edited item, like:

            datagridID.selectedItem

            After that you can do whatever you need with the information. Of course you'll need to validate the fields, etc.....
            • 4. Re: updating datagrid values to database
              sreekar81 Level 1
              I have a datagrid and an "update button" at the bottom. Suppose, if I have 2 rows in the database, they will be displayed. The user edits some of the fields and at the same time, he may add new rows to the grid. When he presses the "update button", all these edited fields and new rows has to be sent to the .net application through httpservice........ I want a sample code for this??
              • 5. Re: updating datagrid values to database
                bmont
                After experiencing exactly what you are going through I will tell you that it is not trivial. Where I find flex works best is in a edit/update immediate type of cycle.

                Once you start using the "scratch pad" concept of storing all your updates and them submitting them all for update takes a lot more work especially if you are dealing with multiple related tables where one record has to be updated before another.

                I think you could use Flex Data Services but if you are looking for a low cost solution you will have to probably serialize your updates with multiple calls to the service.

                I have written a class that will take multiple updates for one table and update the table in one HTTP request. I am using Ruby on Rails as my backend with MySQL as my database.