Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I Have two forms . In One form i have grid view ,,in this grid view i have 5 cells , now i enter the value in this gridview as i tab on the second cell it will go to the 2nd form .in this form i have three textbox . in textbox 1 and 2 i put the value and in 3rd textbox i get a result. till this everything is ok. but now i want to put the text box 3 value into the 2nd cell of the gridview and this form2 will also hide and return back to the form1 with textbox 3 value in 2nd cell of the gridview.
Posted
Updated 18-Apr-14 18:55pm
v2
Comments
Richard MacCutchan 18-Apr-14 4:37am    
Try and think of the steps required, and the variables needed, to achieve this. Save the first value in a temporary variable. When the tab event occurs, show form2 and call some method that will fill in the details, passing the first variable. when you have the result from textbox3, save it again and pass it back to form1 and close form2.

And please, do not mark questions as urgent, we answer these in our own time, and at no cost to you.
Ankit 71 19-Apr-14 0:45am    
sir, i have used ur solution. now when i write ur code on my project it shows an error response.write with red line on the bottom.
and also shows error on "<script language="'javascript.
the error is Too many character in character literel.
Richard MacCutchan 19-Apr-14 4:31am    
I have not provide a solution. I suggest you post your comment at the "Have a Question or Comment" link below the solution provided by syed shanu.

1 solution

tab on the second cell it to the 2nd form ?.
Do you open a popup window using javascript.
If so when you close or click the Ok button from you popup window you can return the reslut to your main form for example like this :

C#
//In you popup form 
 protected void btnConfirm_Click(object sender, ImageClickEventArgs e)
    {
        SelectConfirm(Textbox2.Text,Textbox3.Text);
    }

 protected void SelectConfirm(String result1,String result2)
    {
                  Response.Write("<script language='javascript'>");
            Response.Write("window.returnValue = new Array('" +
                result1 + "','" +  
              result2 + "');window.close();"); 
            Response.Write("</script>");
        }
        else
        {
            message("failed.");
        }
    }

and in your main form you can get the return values in and display in your griview cell.
Note : here i have used my telerik grid sample you can cange to your gridview update
C#
 var res = ShowPopup("form_PopUp.aspx?RESO_CD=''", 1208, 600);
                if (!!res) {

                                 var a = res[0].split("-"); // Delimiter is a string
                                  txtresult1val.set_value(a[1]);
                                  txtresult2val.set_value(a[2]);
txtresult3val.set_value(res[1]);


                            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900