Anybody good with sorting algorithms?

DanielB33

Active member
Joined
Mar 29, 2013
Messages
40
Programming Experience
1-3
I output data to a user (current, voltage, temperature, etc) for motors. The user clicks radio buttons, etc. to select which data they want to see. I import data to a datagrid in my vb app and then have the option for the user to export this to excel. If the user selects voltage and temperature, I need to export only those two columns, but to columns A1 and B1 in excel. If the user selects only Current and ambient Temp, I need to export only those 2 options to excel but to columns A1 and B1. With 6 data import/export options, this becomes many if statements and conditions for exporting scenarios. there must be some algorithms for situations like this? Am I missing somethings?

Currently, when the user selects the "Start" button, the parts of data that the user does not want to export/import become invisible. As of now, I am using this condition to flag whether not I should export the data from that column. Such a seemingly simple task is turning into a pain.

I understand that there are methods for exporting the entire data grid by function, but I have never done this and did not understand what I read about in online, I am new to vb.net and GUI in general. If someone can explain (as if to someone new to programming) how to do this I would be happy as well.

Thanks for the help!
 
Never mind. My method is long and exhausting. I can simply loop through the entire data grid and export. I did not know about the DataGridView1.Columns and DataGridView1.Rows properties
 
Back
Top