如何使用C#在asp.net中将gridview行值显示到文本框 [英] how to display gridview row value to textbox in asp.net using C#

查看:50
本文介绍了如何使用C#在asp.net中将gridview行值显示到文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行模式下如下





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 the GridViewRows. Find the second column value inside the loop and assign to the TextBox.


这篇关于如何使用C#在asp.net中将gridview行值显示到文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆