How do i refresh a datagrid from a popup window without re opening the page...

Discussion in 'ASP .Net Datagrid Control' started by pkenty, May 28, 2004.

  1. pkenty

    pkenty Guest

    Hi, does any one know how to refresh a datagrid on one page from another page without having to load the whole page again

    Let me explain

    Ive got a page with 4 tabs on it with different datagrids in each tab..I have a add button on one page that open a new pop up window which allows the user to add a new resource to the datagrid...Once the user has selected a resource to add to the datagrid , i want the page to send an event to the Main datagrid page to refresh the data grid to show the new added record... I dont want to have to use window.opener to re open the whole window because the whole page refreshing is too slow..

    Any ideas
    Thank
    Paul
     
    pkenty, May 28, 2004
    #1
    1. Advertising

  2. pkenty

    Kilic Beg Guest

    Hi,

    your question peeked my interest...
    I spend couple hour to figure it out but I guess I fond the solution...
    below is the HTML code and Javascript:
    ====================================
    <html>
    <head>
    <script language="javascript">
    function addRow(strCol1, strCol2, strCol3, strCol4, strCol5, strCol6)
    {
    var MainTbl = document.getElementById("tblTestID");
    var rowcopy = MainTbl.rows[MainTbl.rows.length-1].cloneNode(true);
    MainTbl.rows[MainTbl.rows.length-1].cells[0].innerHTML = strCol1;
    MainTbl.rows[MainTbl.rows.length-1].cells[1].innerHTML = strCol2;
    MainTbl.rows[MainTbl.rows.length-1].cells[2].innerHTML = strCol3;
    MainTbl.rows[MainTbl.rows.length-1].cells[3].innerHTML = strCol4;
    MainTbl.rows[MainTbl.rows.length-1].cells[4].innerHTML = strCol5;
    MainTbl.rows[MainTbl.rows.length-1].cells[5].innerHTML = strCol6;
    MainTbl.rows[MainTbl.rows.length-2].appendChild(rowcopy);
    }
    </script>
    </head>
    <body>
    <DIV id="DivMain">
    <table id="tblTestID" width="600" cellspacing="0" cellpadding="0"
    border="1">
    <tr>
    <td>Row 1 Col 1</td>
    <td>Row 1 Col 2</td>
    <td>Row 1 Col 3</td>
    <td>Row 1 Col 4</td>
    <td>Row 1 Col 5</td>
    <td>Row 1 Col 6</td>
    </tr>
    <tr>
    <td>Row 2 Col 1</td>
    <td>Row 2 Col 2</td>
    <td>Row 2 Col 3</td>
    <td>Row 2 Col 4</td>
    <td>Row 2 Col 5</td>
    <td>Row 2 Col 6</td>
    </tr>
    <tr>
    <td>Row 3 Col 1</td>
    <td>Row 3 Col 2</td>
    <td>Row 3 Col 3</td>
    <td>Row 3 Col 4</td>
    <td>Row 3 Col 5</td>
    <td>Row 3 Col 6</td>
    </tr>
    </table>
    </DIV>
    <BR>
    <BR>
    <a href="javascript:addRow('Row 4 Coll 1','Row 4 Coll 2','Row 4 Coll
    3','Row 4 Coll 4','Row 4 Coll 5','Row 4 Coll 6');">addRow</a>
    </body>
    </html>
    =====================================
    just call addRow function from your popUp window before your close it and
    pass the valuues for it..

    ----------------
    Kilic Beg

    "pkenty" <> wrote in message
    news:D...
    > Hi, does any one know how to refresh a datagrid on one page from another

    page without having to load the whole page again?
    >
    > Let me explain.
    >
    > Ive got a page with 4 tabs on it with different datagrids in each tab..I

    have a add button on one page that open a new pop up window which allows the
    user to add a new resource to the datagrid...Once the user has selected a
    resource to add to the datagrid , i want the page to send an event to the
    Main datagrid page to refresh the data grid to show the new added record...
    I dont want to have to use window.opener to re open the whole window because
    the whole page refreshing is too slow...
    >
    > Any ideas?
    > Thanks
    > Paul
     
    Kilic Beg, May 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?T3Bh?=

    How to refresh calling window from a popup window

    =?Utf-8?B?T3Bh?=, Jun 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    15,092
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jun 14, 2006
  2. Pkenty
    Replies:
    0
    Views:
    431
    Pkenty
    May 28, 2004
  3. Raffi
    Replies:
    4
    Views:
    260
    Dr John Stockton
    Aug 12, 2004
  4. Replies:
    2
    Views:
    492
  5. Jimmy
    Replies:
    1
    Views:
    342
    Thomas 'PointedEars' Lahn
    Oct 6, 2007
Loading...

Share This Page