Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
How to pass gridview values to textbox in asp.net using c#?


Thanks&Regards
Hari
Posted
Comments
pryashrma 28-Nov-12 5:31am    
please specify how u r creating gridview... either auto genratin columns or through designing them
Hari Krishna Prasad Inakoti 28-Nov-12 5:50am    
auto genaration only
[no name] 28-Nov-12 6:09am    
when do u want this to happen?any event?
Hari Krishna Prasad Inakoti 28-Nov-12 6:20am    
rowediting
[no name] 28-Nov-12 7:31am    
okay

1 solution

This is My Solution:

C#
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
   {
       txtid.Enabled = true;
       txtid.Text = GridView1.Rows[e.NewEditIndex].Cells[1].Text.ToString();
       txtname.Text = GridView1.Rows[e.NewEditIndex].Cells[2].Text.ToString();
       txtage.Text = GridView1.Rows[e.NewEditIndex].Cells[3].Text.ToString();
       txtaddress.Text = GridView1.Rows[e.NewEditIndex].Cells[4].Text.ToString();
   }
 
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