如何将值从Gridview Rowediting事件传递到文本框? [英] How to pass values from Gridview Rowediting event to textbox ?

查看:55
本文介绍了如何将值从Gridview Rowediting事件传递到文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想将gridview值传递到文本框(不在gridview中).在Gridview Rowediting事件中怎么可能?

数据库名称:Expt
表名称:客户
Gridview:Gridciew2
文本框:txtCity和txtPhone

Hello,

I want to pass gridview values to textboxes(not in gridview). How is it possible in Gridview Rowediting event?

database name : Expt
Table Name: Customer
Gridview: Gridciew2
textbox: txtCity and txtPhone

protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
{
          // // //   What will be the code ????? 
}


<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"

                  AutoGenerateDeleteButton="True"

                  onrowdeleting="GridView2_RowDeleting" DataKeyNames="Sr_No"

                  onrowediting="GridView2_RowEditing" AutoGenerateSelectButton="True"

                  onselectedindexchanged="GridView2_SelectedIndexChanged"   >
                  <Columns>
                        <asp:BoundField HeaderText="City" DataField="City" >
                        <HeaderStyle ForeColor="CadetBlue" />
                        <ItemStyle ForeColor="Indigo" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Phone" DataField="phone" >
                        <HeaderStyle ForeColor="CadetBlue" />
                        <ItemStyle ForeColor="Indigo" />
                        </asp:BoundField>
                        <asp:CommandField ShowEditButton="True" />
                  </Columns>
            </asp:GridView>

推荐答案

只需在这里看看:
Just have a look here: MSDN: GridView.RowEditing Event[^]

It tells in detail with example of how to use it. Try!


GridView.RowEditing Event

I hope the above information will be helpful. If you have more concerns, please let me know.


这篇关于如何将值从Gridview Rowediting事件传递到文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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