获得正确的数据视图记录 [英] get the right dataview record

查看:57
本文介绍了获得正确的数据视图记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用.NET2003 C#windows表单应用程序,我在我的表单中添加了一个数据网格,如下所示:

I work with .NET2003 C# windows form application, i add a datagrid in my form like this:

展开 | 选择 | 换行 | 行号

推荐答案

使用事件SelectionChanged它将为您提供一组单元格。

然后在里面你可以检查dataCrids(或类似的东西)datagridview的概率,并用它来通过用户选择的各个单元格进行迭代。
Use the event "SelectionChanged" it will give you a collection of the cells.
Then inside you can check SelectedCells (or something like that) propery of the datagridview and use it to itterate through the various cells the user has selected.



使用事件SelectionChanged它将为您提供一组单元格。

然后在内部,您可以检查dataCrids(或类似的东西)datagridview的概率,并使用它来通过用户选择的各个单元格进行迭代。
Use the event "SelectionChanged" it will give you a collection of the cells.
Then inside you can check SelectedCells (or something like that) propery of the datagridview and use it to itterate through the various cells the user has selected.



我已尝试过CellSelectionChanged,但参数sender是指的是DataGrid本身,参数EventArgse指的是DataGrid。引用我不能用的东西。我也尝试使用dataViewProduct.FindRows((object)productID);并且它很容易找到,但我不知道如何捕获dataGridPoduct单元格中的值。如果可以的话,至少我可以使用dataViewProduct.FindRows。如果有另一种方法可以做到这一点,请让我知道,因为我有点生病,只是因为我无法在.NET中找到方法来做到这一点。感谢您的关注。

i''ve tried the "CellSelectionChanged", but the parameter "sender" refers to DataGrid itself, and parameter EventArgs "e" referes to something that i can''t use. i also try to use dataViewProduct.FindRows((object)productID); and it''s successful to find, but i don''t know how to catch the value within the dataGridPoduct cell. If it can, at least i can use dataViewProduct.FindRows. If there''s another way to do it, please let me know, coz i kinda sick somehow, just because i can''t find the way in .NET to do it. Thanks for your attention.


假设您有一个名为dgvList的datagridview
Say you have a datagridview called dgvList
展开 | 选择 | Wrap | 行号


这篇关于获得正确的数据视图记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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