如何将一个表单的文本框值放入另一个表单的gridview单元格中。 [英] How to put the textbox value of one form into the gridview cell of another form.

查看:123
本文介绍了如何将一个表单的文本框值放入另一个表单的gridview单元格中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种形式。在一种形式我有网格视图,在这个网格视图中我有5个单元格,现在我输入此gridview中的值作为第二个单元格上的i选项卡它将转到第二个表单。在此表单中我有三个文本框。在文本框1和2中我输入值,在第3个文本框中我得到一个结果。直到这一切都还好。但是现在我想把文本框3的值放到gridview的第二个单元格中,这个form2也会隐藏并返回到grid1的第二个单元格中带有textbox 3值的form1。

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.

推荐答案

选项卡在第二个单元格上它到第二个表单?。

你是否使用javascript打开一个弹出窗口。

如果是这样,当你关闭时或者从弹出窗口中单击确定按钮,您可以将结果返回到主表单,例如:



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 :

//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.");
        }
    }



,在您的主表单中,您可以获得返回值并显示在您的griview单元格中。

注意:这里我使用了我的telerik网格样本,你可以使用你的gridview更新


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

 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]);


                            }


这篇关于如何将一个表单的文本框值放入另一个表单的gridview单元格中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆