通过列获取datagrid的值 [英] Getting value on datagrid by columns

查看:103
本文介绍了通过列获取datagrid的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道标题为 id 的列中某一行的价值:

How do you know the value of a particular row in the column titled id:

 row_index | id
-----------+-----
    0      | 54

    1      | 34

    2      | 12

select id where row_index = 1 for例如,我应该得到一个值34。

select id where row_index = 1 for example, I should get a value of 34.

这是 datagrid

推荐答案

不完全确定你正在寻找这个,
无论如何,你可以通过给列列名和行索引访问特定的单元格值

Not exactly sure you looking for this, Anyway you can access the particular cell value by giving the column name and the row index

var value = datagrid["id",rowindex].Value.ToString();

这篇关于通过列获取datagrid的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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