Datagridview和数组 [英] Datagridview and arrays

查看:101
本文介绍了Datagridview和数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作程序,在一个部门完成后将产品发送给其他用户/部门。所以我正在尝试将数组合并到产品应该去的下一个部门的指定列表中。

我还没有任何代码,因为我仍然找到了我的方位......但是我想知道是否



是否可以从datagridview中选定行的单个单元格创建一个数组,这将决定下一步该去哪里。



我尝试过:



从列表视图创建数组。在线信息不多

I’m making program which sends products to other ‘users/departments’ when one department is finished. So I’m trying to incorporate arrays for the specified list of departments the product should go to next.
I haven’t got any code yet, as I’m still finding my bearings... but I was wondering if

Is it possible to create an array from a singular cell from the selected row in the datagridview which would determine where to go next.

What I have tried:

Creating an array from list view. Not much information online

推荐答案

我不会为此使用数组,而是一种特殊的数组,称为Queue [ ^ ] - 至少对于一个简单的工作流程。



您应该阅读可能有用的模式

责任链模式 - 了解并实施C#中的责任链模式 [ ^ ]

或可能是状态模式了解和实施C#中的状态模式 [ ^ ]

或者可能是管道模式 C#中的简单管道实施 [ ^ ]



绝对不要将工作流存储为数据网格视图的单个单元格中的逗号分隔项目!



希望我列出的文章(它们都在这里CodeProject)将帮助您入门
I wouldn't use an array for this, but a special kind of array called a Queue[^] - at least for a simple workflow.

You should probably read up on patterns that could help
The "Chain of Responsibility" pattern - Understanding and Implementing Chain of Responsibility Pattern in C#[^]
or possibly a State pattern Understanding and Implementing State Pattern in C#[^]
or possibly a Pipeline pattern Simple Pipeline Implementation in C#[^]

Definitely do not store the workflow as a comma-separated item in a single-cell of a datagridview!

Hopefully the articles I listed (they are all here on CodeProject) will help to get you started


这篇关于Datagridview和数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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