如何获得网格的选定值 [英] How to get selected value of a grid

查看:88
本文介绍了如何获得网格的选定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Gridview.
并使用以下代码获取选定的单元格值.但是我得到的字符串mn是"
GridViewRow行=网格贷款官员.SelectedRow;
字符串mn = row.Cells [1] .Text.ToString();

I use Gridview.
And use below code for get the selected cell value. But I got string mn is " "
GridViewRow row = gridloanofficer.SelectedRow;
string mn = row.Cells[1].Text.ToString();

推荐答案

由于您问题中的信息稀缺,我假设有几件事:
i)您正在使用GridView.
ii)您需要所选行的data key值.

可以使用 GridView.SelectedValue属性 [ ^ ].

如果这不是您要问的问题,则需要在问题中添加更多详细信息.
Due to scarcity of information in your question, I am assuming few things:
i) You are using a GridView.
ii) You need data key value of the selected row.

This can be done using GridView.SelectedValue Property[^].

If this is not what you wanted to ask, you need to add more details to your question.


这篇关于如何获得网格的选定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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