Click here to Skip to main content
15,925,255 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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

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

XML
<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>
Posted
Updated 6-May-11 9:06am
v3

Just have a look here: MSDN: GridView.RowEditing Event[^]

It tells in detail with example of how to use it. Try!
 
Share this answer
 
Comments
Wonde Tadesse 6-May-11 20:06pm    
Good example.
Sandeep Mewara 6-May-11 23:09pm    
Thanks.
sat_100m 7-May-11 2:25am    
Thnx....
GridView.RowEditing Event

I hope the above information will be helpful. If you have more concerns, please let me know.
 
Share this answer
 
Comments
Monjurul Habib 7-May-11 11:43am    
apologize wrong 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