• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

.net datagrid return value


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
1 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now