如何在智能手机应用程序中的 DataGrid 中获取选定的行?

发布于 2024-09-13 07:06:51 字数 74 浏览 1 评论 0原文

我正在开发一个智能手机应用程序,其中我有一个 winform 中的 DataGrid。

我想获取所选行的单元格的值..

I am working on a smartphone application, where I have a DataGrid in winform.

I want to get the value of cell of the selected row..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

染年凉城似染瑾 2024-09-20 07:06:51

这将返回智能手机应用程序中 DataGrid 选定单元格的值

   MessageBox.Show(dgDataGrid[dgDataGrid.CurrentCell.RowNumber,
 dgDataGrid.CurrentCell.ColumnNumber].ToString());

通过此您可以获取或设置单元格值。

This will return the value of selected cell of DataGrid in smartphone application

   MessageBox.Show(dgDataGrid[dgDataGrid.CurrentCell.RowNumber,
 dgDataGrid.CurrentCell.ColumnNumber].ToString());

Through this you can get or set the cell value.

南薇 2024-09-20 07:06:51

由于缺乏信息,如果我们的方法来自旧的 VB.net 紧凑框架项目,那么这里是一种 hack。

For i As Integer = 1 To DataGrid.VisibleRowCount - 1

  If DataGrid.IsSelected(i) Then

    MessageBox.Show(DataGrid.Item(i, 0).ToString())

  End If

Next

这将显示一个消息框,其中包含每个选定行的第一个单元格的内容。

Through lack of information here is a hack of one if our methods from an old VB.net compact framework project.

For i As Integer = 1 To DataGrid.VisibleRowCount - 1

  If DataGrid.IsSelected(i) Then

    MessageBox.Show(DataGrid.Item(i, 0).ToString())

  End If

Next

This will show a message box with the contents of the first cell of each selected row.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文