Link to home
Start Free TrialLog in
Avatar of ocaccy
ocaccyFlag for Japan

asked on

C# - How Show thet myArray in DataGridView?

How to show the content of the array on dataGridView?

myArray1[320,4]
dataGridView1

ocaccy
ASKER CERTIFIED SOLUTION
Avatar of TJCombos
TJCombos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Kiran Sonawane
Kiran Sonawane
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Hi sonawanekiran

I need to enter data into the correct cells.
Phase 1 - data collection and storage in the arrays.
Phase 2 - will take the minimum and maximum selections string myArrays[320,4] and store in double myArray9[320,18].
Phase 3 - we'll take the average of the Selections of the double myArray9[320,18] and store in double myArray10[32,18].
Phase 4 - will take the minimum and maximum of the selections of the double myArray10[32,18] and store in double myArray11[10,6].
5th stage - we will take the values ¿¿in myArray11[10,6] and launched in ZedGraph with graphic line.
At all stages put the values ¿¿in datagridviews.

So I need to put the data right
Best Regards,
ocaccy
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

I'll explain, but first want to say that do not know if arrays[,] is the best choice.
If they have a good tip, I would like to hear.

My project has six devices RS485 connected to the PC by converter RS485/USB.
I get the data in string form
(01,03260,00552,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_01 = new string[240, 4];
(02,03260,00554,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_02 = new string[240, 4];
(03,04253,00552,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_03= new string[240, 4];
(04,03460,00554,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_04 = new string[240, 4];
(05,03260,00556,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_05 = new string[240, 4];
(06,06260,00557,00032, message, message)
I'm currently trying to put a string in to public string[,] a_i_id_06 = new string[240, 4];
devices at intervals of 10 seconds.
I have to put these strings somewhere to work with them in later phases.

I need to display them in datagridview so entering the arrays.

ocaccy
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Hi, guys.

Dani, your suggestion seems to me a way.
I'm getting data from the devices: ID01, ID02, ID03, ID04, ID05, ID06 every 10 seconds, but still do not know how to send data to the arrays as they arrive, and how to show these arrays to check they are receiving the data.

It has a model that I can learn?

Regards,
ocaccy
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

¿01,00668,00047,00056,message, message

I don´t need this symbol. ¿

ocaccy
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

I don´t know this.
How do this?

Regards
ocaccy
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Hi guys.

TJCombos.

How do this with the arrays, for example string[,] a_i_id_01 = new string[240, 4]; ?
string[,] a_i_id_01 = new string[240, 4]; 
//ArrayList s = new ArrayList();
s.Add("1st Item");
s.Add("2nd Item");
GridView1.DataSource = s.ToArray(typeof(string));
GridView1.DataBind();

Open in new window

Avatar of ocaccy

ASKER

Hi, VijayBalkawade.
I don´t know how to connect the array in datatable in datagridview.
My array is double a_i_sagyou1 [240.18].
Do you have a tip?

ocaccy
DataTable dt = new DataTable();
            dt.Columns.Add("ID", typeof(int));
            dt.Columns.Add("Name", typeof(string));

            dt.Rows.Add(1, "Batman");
            dt.Rows.Add(2, "Spiderman");

            dataGridView1.DataSource = dt;

Open in new window

Avatar of ocaccy

ASKER

Thank you.