如何使用c#将gridview值传递给asp.net中的文本框? [英] how to pass gridview values to textbox in asp.net using c#?
本文介绍了如何使用c#将gridview值传递给asp.net中的文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何使用c#将gridview值传递到asp.net中的文本框?
谢谢与问候
Hari
Hi All,
How to pass gridview values to textbox in asp.net using c#?
Thanks&Regards
Hari
推荐答案
这是我的解决方案:
This is My Solution:
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();
}
这篇关于如何使用c#将gridview值传递给asp.net中的文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文