如何使用对象Datasource从TextBox中的Gridview获取所选行的值 [英] How to get the Values of Selected Row from a Gridview in TextBox using object Datasource
本文介绍了如何使用对象Datasource从TextBox中的Gridview获取所选行的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用对象Datasource
How to get the Values of Selected Row from a Gridview in TextBox using object Datasource
推荐答案
从TextBox中的Gridview获取所选行的值:使用以下代码:
Use the following Code :
void Button1_Click(Object sender, EventArgs e)
{
// Get the currently selected row using the SelectedRow property.
GridViewRow row = CustomersGridView.SelectedRow;
// In this example, the first column (index 0) contains
TextBox1.Text = row.Cells[0].Text;
}
尝试
Try
// get the values of selected row from a Gridview and display the values in textboxes using C# code.
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = GridView1.SelectedRow.Cells[0].Text;
}
这是如何使用ASP.NET从TextBox中的Gridview获取所选行的值 [ ^ ]文章很好地学习如何从GridView中获取选定的行值。
This How to get the Values of Selected Row from a Gridview in TextBox using ASP.NET[^] article is good to learn how to get selected row values from a GridView.
Google? [ ^ ]:叹息:
GridView.Selected行属性 [ ^ ]
Google?[^]:sigh:
GridView.SelectedRow Property[^]
这篇关于如何使用对象Datasource从TextBox中的Gridview获取所选行的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文