如何使用C#在asp.net中将gridview行值显示到文本框 [英] how to display gridview row value to textbox in asp.net using C#
问题描述
在运行模式下如下
Coursemajorcode AMC(下拉列表)Courseminorcode MC(下拉列表)按钮(添加)
EFA
当我点击添加按钮时,AMC和MC将显示在gridview中。
在gridview中如下
Coursemajorcode Courseminorcode
AMC MC
AMC EFA
我有一个文本框如下
Pakcagedescription textbox1。
当我点击gridview中的添加按钮时,gridview MC和EFA中的courseminorcode将显示在textbox1中。
我怎么能在asp中做.net使用c#。
In run mode as follows
Coursemajorcode AMC(Dropdownlist) Courseminorcode MC(Dropdownlist) Button(add)
EFA
When i click the add button AMC and MC will be displayed in the gridview.
In gridview as follows
Coursemajorcode Courseminorcode
AMC MC
AMC EFA
I have one textt box as follows
Pakcagedescription textbox1.
The courseminorcode from the gridview MC and EFA to be displayed in the textbox1 when i click the add button in gridview.
for that how can i do in asp.net using c#.
推荐答案
循环遍历GridViewRows
。在循环中找到第二列值并分配给TextBox
。
Loop through theGridViewRows
. Find the second column value inside the loop and assign to theTextBox
.
这篇关于如何使用C#在asp.net中将gridview行值显示到文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!