如何通过在c#中传递字符串来获取行 [英] how to get a row by passing a string in c#
本文介绍了如何通过在c#中传递字符串来获取行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Datagridview调用gvMasterData,它包含如下数据
类型,金额和余额是列
类型/金额/余额---- //这是三列标题
现金100 80
卡450 300 //这两行值得
我有一个名为getvalue的按钮和
我想传递Cash之类的参数,并希望得到相关的行值
我该怎么做
I Have a Datagridview Call gvMasterData, It''s contain data as follows
Type,Amount And Balance are columns
Type/ Amount/ Balance ----//this are three columns header
Cash 100 80
Card 450 300 // this two lines are values
I have a button called getvalue and
I want to pass "Cash" like parameter and want to get related row values
how can i do this requirement
推荐答案
使用以下代码:
GridView1.Rows [e.RowIndex] .columns [0] .value;
On Your Event
Use The Following Code:
GridView1.Rows[e.RowIndex].columns[0].value;
On Your Event
这篇关于如何通过在c#中传递字符串来获取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文