I have the following on a Winform:
- Button - to open *.txt file, code already done and works
- Combo Box - Display the dates found
- Datagridview - show information for the date selected
What code I have so far is:
Sample of text file:
What I want exactly is to show the date as follows in the combo box:
When the user selects this date the datagridview will show:
I have struggled finding a way to do this so any and all help will be appreciated.
- Button - to open *.txt file, code already done and works
- Combo Box - Display the dates found
- Datagridview - show information for the date selected
What code I have so far is:
C#:
private void Historybutton_Click(object sender, EventArgs e)
{
SSBPgroupBox.Enabled = false;
DataTable HFdt = new DataTable();
DialogResult result1 = openFileDialog2.ShowDialog();
if (result1 == DialogResult.OK) // Test result.
{
String Fname = openFileDialog2.FileName;
string raw_text = System.IO.File.ReadAllText(Fname);
//add headers to datagrid view
HFdt.Columns.Add("Sequence");
HFdt.Columns["Sequence"].DataType = Type.GetType("System.Int32");
HFdt.Columns.Add("Timing");
HFdt.Columns["Timing"].DataType = Type.GetType("System.Int32");
}
HistorydataGridView.DataSource = HFdt;
}
Sample of text file:
17/05/15-16:40:13:BLAST DRIVER ON
BLASTING PLAN
PU1053 (0005 DETS):
1/7B7C35;11/7B70B2;21/7B7058;31/7B83A1;41/7B70D1;
BLAST SUMMARY
1 PU, 00005 DETS
DELAYS MIN/MAX IN MS : 00001 / 00041
GAP MIN/MAX IN MS : 00010 / 00010
16:40:32:LINE TEST
CALIBRATION
EXTRA DETS :None
INTERMITTENT CONNECTION DETS :None
TEST DETS
MISSING DETS :None
OUT OF ORDER DETS :None
INCOHERENT DETS :None
DELAY ERRORS DETS :None
16:41:52:TEST END
16:44:02:CHARGE
CHECK ENERGIE
ADDITIONAL MISSING DETS :None
LOW ENERGY DETS :None
ADDITIONAL INCOHERENT DETS :None
16:44:29:FIRE
What I want exactly is to show the date as follows in the combo box:
17/05/15 - 0005 Dets
When the user selects this date the datagridview will show:
Sequence Timing
1 1
2 11
3 21
4 31
5 41
I have struggled finding a way to do this so any and all help will be appreciated.