Delete Record From Datagrid

Posted on 2004-10-27
Last Modified: 2010-04-03
Using the example from Negatyve , does anyone know how to delete a record from the database using the datagrid? If so, can you please provide and example or point me in the right direction.  Any help would be greatly appreciated.  Thanks in adavance.

Question by:Justice75

    Author Comment

    The example that I am refering to is using the LoadVars object not the XML emaple.  Thanks.

    Author Comment


    Can anyone show me how to get the value of a record that was loded into a datagrid.  I think that I can send it the ASP page an ddelete the record.  However, how do I reload the datagrid?  Would I reload the loadVars object once the record ID (MMID) is sent to the ASP page.  Well I guess that I can just experiment once I figure out how to get the value of teh reord id from the selected record.  I have included the AS file.  Thanks for any help.


    //this code checks the main swf root to see if the user has logged in
         if (_root.logged.text ==""){
              status.text = "YOU MUST BE LOGGED IN TO ACCESS YOUR MESSAGES";
              } else {
              status.text = "";
    //load vars
    data_var = new LoadVars();
    //any number can be plugged in here- the main swf root supplies this to this swf and passes it to the asp page that selects
    //the records based on this value
    data_var.ID = _root.logged.text;
    data_var.path = this;
    data_var.onLoad = function(success)
              var dataProv = [];
              for(var i = 0; i < Number(this.tot); i++){
                   var item = {};
                   item.Date = this["MMDate" + i];
                   item.ID     = this["MMID" + i];
                   item.From     = this["FromID" + i];
                   item.Subject = this["Subject" + i];
                   item.Message = this["Message" + i];
                   item.Total = this["tot"];

              iMCounter.text = item.Total;
              //column names, column info and dataProvider
              this.path.data_dg.columnNames = ["Date", "ID", "From", "Subject"];
              this.path.data_dg.dataProvider = dataProv;

              this.path.data_dg.getColumnAt(0).width = 150;
              this.path.data_dg.getColumnAt(1).width = 30;
              this.path.data_dg.getColumnAt(2).width = 50;
              this.path.data_dg.getColumnAt(3).width = 140;

    data_var.sendAndLoad("http://localhost/PartyList/Pages/Profile/proMVLoad.asp", data_var, "POST");

    myGridListener = new Object();
    myGridListener.change = function (eventObj)
         var eventSource =;
         var theSelectedItem = eventSource.selectedItem;
         var theSelectedItemMessage = theSelectedItem.Message;
         info.text = "Message:  " + theSelectedItemMessage;
    data_dg.addEventListener("change", myGridListener);
    LVL 27

    Expert Comment

    Actually, what aren't you able to do?

    Author Comment

    WOW Hi Negatyve!,

    I want to be able to delete a record using the example that you provided.  I added a few extra lines of code and a text area bu it's the same code.  Thanks a bunch for  your time.


    LVL 27

    Expert Comment

    ok, gimme time to make you an example.. :)

    Author Comment

    ok thanks
    LVL 27

    Accepted Solution


    Author Comment

    Thanks Alot

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Title # Comments Views Activity
    adobe reader 12 373
    Link puzzle piece images together and change color on hover 2 412
    Microsoft WSUS 4 74
    Action Script coding 1 165
    I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now