Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 25-Apr-18 9:33am
v2
Comments
Maciej Los 24-Apr-18 9:45am    
Can you be more specific an provide more details about your issue?
At this moment your question is completely unclear.
Member 13765884 24-Apr-18 9:59am    
At the moment, I want to know how to make an array using the items in the cell that I have
CHill60 24-Apr-18 10:28am    
You're still not being clear. For example: a cell will hold a single visible item - in what way do you want to convert that to an array?
- Why do you want an array?
- What do you mean by a department being "finished"
It sounds as if you are trying to create a workflow - is that the case?
Member 13765884 24-Apr-18 10:32am    
The cell will hold multiple items like ... ‘analysing, cleaning, fixing, repairing’.
So when the ‘analysing’ department have finished analysing, the product moves to the ‘cleaning’ department
I thought an array would be the best way to do this with. Is that not so?

Yes, I am trying to create a workflow. Thank you
F-ES Sitecore 24-Apr-18 11:33am    
That's not multiple items, it's a single string. As said, a cell can only hold a single thing.

1 solution

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
 
Share this answer
 
Comments
Maciej Los 24-Apr-18 11:08am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900