VB.NET DataGridView - 所有列到一列 - 将行记录到一列

发布于 2025-01-07 13:08:11 字数 913 浏览 0 评论 0原文

您好,

我已经尝试一个概念超过 3 个小时,但似乎无法正确理解。我已经废弃了所有代码,并准备在一些指导下重新开始。因此,无论是谁能够为我指明正确的方向,或者解决我的问题,我都会非常感激。

背景:

我正在尝试在 VB.NET 中实现 DataViewGrid,它只是用于识别和选择数据库中已有的 GIS 功能。 DataGrid 和 DataSet 非常简单,尽管有一点小小的不同。

问题:

首先,我需要能够根据[Name]列的一条记录填充网格> 从组合框中选择(我已经能够填充组合框,但不能填充网格)。

第二,我需要重构 DataGridView,以便每个当前列名称位于名为 "Field" 的列以及该记录的行中选择的内容位于另一列名为“值”的列中。


进一步说明

在 ArcMap 中,有一个识别工具:


看到的,每个“字段” 都是一个列名称,每个“值” 是每一列的一条记录。

因此,如果我能够以某种方式将所有列名称解析为 "Field" 列,并为每个 填充一个记录,并填充 "Value" 列[姓名],我会走上幸福之路。

如果我能做些什么来帮助您,请告诉我,并感谢您提前抽出时间并提供意见。

此致

洛根

Greetings,

I have been trying a concept for over 3 hours, and I cannot seem to get it right. I am to the point where I have scrapped all of my code, and I am ready to start off again with some guidance. So, to whomever here can either point me in the right direction, or solve my problem, I would be more than grateful.

Background:

I am trying to implement a DataViewGrid in VB.NET that will be simply for identifying and selecting GIS features that are already within a database. Simple enough with DataGrids and DataSets, although there is one slight twist.

Problem:

First, I need to be able to populate the grid based on one record of the column [Name] that is chosen from a ComboBox(I have been able to populate the ComboBox, but not the grid).

Second, I need to restructure the DataGridView so that each current column name is in a column called "Field" and the row for that one record chosen is in another column called "Value".


For Further Clarification:

In ArcMap, there is an Identify Tool:

enter image description here


As you can see here, each "Field" is a column name and each "Value" is one record for each of those columns.

So, if I could somehow parse through all of the column names into a "Field" column, and also populate a "Value" column with one record for each [Name], I would be on the road to happiness.

If there is anything I can do to help you help me, please let me know, and thank you for your time and input in advance.

Sincerely,

Logan

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

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

发布评论

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

评论(1

—━☆沉默づ 2025-01-14 13:08:11

转置数据

发现这个问题提出了同样的问题

C#/WPF: Toolkit DataGrid - 转置行和列

Transpose your data

Found this question which asks the same thing

C#/WPF: Toolkit DataGrid - Transpose rows and columns

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