.net datagrid return value

Posted on 2006-05-24
Last Modified: 2010-04-17

i am perplexed...

I have an asp .net page that has a button to open a popup window (addressbook) to allow users to quickly fill in information.  In that window (new address book window) is a datagrid with addresses.  

How do I get the selected datagrid value back to the initial screen prior to the user opening the address book window?

.new vb
Question by:sailing42
    1 Comment
    LVL 2

    Accepted Solution

    Actually ... your design is really ... it seems that you want users to enter data through a pop-up webform (namely FormB) and return the result to the parent form (namely FormA) right?  First of all using datagrid is not a good idea since DataGrid used to be shown multiple records (Display), but it is not good to be edited by users.  However if you insist to do so, you can use javascript to get all the datagrid's child controls value back to FormA, but it is really complex.  Have a check on the following items you will see what I am talking about:

    For datagrid:
    You have to find the way to add Template Controls in datagrid

    For the FormB submit button, you have to do some trick like:
    <input type="button" onclick="PostToFormA()"/>
    <script language="javascript">
        function PostToFormA()
             // Collect all the values you want from the datagrid, this is not an easy task,
            // you have to find a way to get them by knowing their ID and
           // use document.getElementById(YourControlIdHere) ....

           // I assume you know javascript well, if you are new to programming,
           // forget about it

          // Thereafter, you have to use window.opener.XXXXX to store back your data to formA

    I hope this help however your question is not an easy task.


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Visual xHarbour 1 48
    for loop with Set 4 38
    How to split this in C++ 4 52
    Program to display an alert on Windows Toolbar 2 32
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    733 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

    17 Experts available now in Live!

    Get 1:1 Help Now