-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataGridForm.cs
More file actions
31 lines (29 loc) · 974 Bytes
/
dataGridForm.cs
File metadata and controls
31 lines (29 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System.Windows.Forms;
using CsvHelper;
using System.IO;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace dataGridForm
{
public partial class dataGridForm : Form
{
public dataGridForm()
{
InitializeComponent();
List<DataSet> dataValues;
using (var reader = new StreamReader(@"C:\Users\Compl\Documents\programUnitsTest.csv"))
using(var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
{
dataValues = csv.GetRecords<DataSet>().ToList();
}
dataGridOutput.DataSource = dataValues;
}
private void dataGridOutput_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
dataCellView cellData = new dataCellView();
cellData.dataTxBx.Text = this.dataGridOutput.CurrentCell.Value.ToString();
cellData.Show();
}
}
}