Click here to Skip to main content
15,885,309 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need Help Desperately! Development server trying to find local server path Pin
BigLitz6-Jul-17 5:59
BigLitz6-Jul-17 5:59 
GeneralRe: Need Help Desperately! Development server trying to find local server path Pin
OriginalGriff6-Jul-17 6:05
mveOriginalGriff6-Jul-17 6:05 
GeneralRe: Need Help Desperately! Development server trying to find local server path Pin
BigLitz6-Jul-17 8:12
BigLitz6-Jul-17 8:12 
GeneralRe: Need Help Desperately! Development server trying to find local server path Pin
OriginalGriff6-Jul-17 8:18
mveOriginalGriff6-Jul-17 8:18 
QuestionFacebook SDK not geting mail Id Undifined Pin
waghniteen5-Jul-17 23:22
professionalwaghniteen5-Jul-17 23:22 
AnswerRe: Facebook SDK not geting mail Id Undifined Pin
Pete O'Hanlon6-Jul-17 1:22
mvePete O'Hanlon6-Jul-17 1:22 
QuestionCrystal Report, Generate same report , multiple times with different parameters as one pdf Pin
beker_usa5-Jul-17 8:27
beker_usa5-Jul-17 8:27 
QuestionText file search, combobox and Datagridview C# Help Pin
Member 132944085-Jul-17 2:15
Member 132944085-Jul-17 2:15 
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:

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

The date is obtained from the search for all dates and returning line 1 to the combobox and the 0005 dets from line 5 as in the sample.

When the user selects this date the datagridview will show:

>Sequence Timing
>
>1 1
>
>2 11
>
>3 21
>
>4 31
>
>5 41

The sequence is automatically created.
The Timing is obtained from Line 7 in the sample

I have struggled finding a way to do this so any and all help will be appreciated.
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier5-Jul-17 2:30
mveRalf Meier5-Jul-17 2:30 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 132944085-Jul-17 3:03
Member 132944085-Jul-17 3:03 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier5-Jul-17 7:23
mveRalf Meier5-Jul-17 7:23 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440813-Jul-17 0:00
Member 1329440813-Jul-17 0:00 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier13-Jul-17 0:24
mveRalf Meier13-Jul-17 0:24 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440813-Jul-17 21:35
Member 1329440813-Jul-17 21:35 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier13-Jul-17 21:52
mveRalf Meier13-Jul-17 21:52 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440813-Jul-17 22:20
Member 1329440813-Jul-17 22:20 
AnswerRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier13-Jul-17 22:39
mveRalf Meier13-Jul-17 22:39 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440813-Jul-17 22:57
Member 1329440813-Jul-17 22:57 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier14-Jul-17 1:59
mveRalf Meier14-Jul-17 1:59 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440814-Jul-17 2:10
Member 1329440814-Jul-17 2:10 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440814-Jul-17 3:07
Member 1329440814-Jul-17 3:07 
AnswerRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier14-Jul-17 9:41
mveRalf Meier14-Jul-17 9:41 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440817-Jul-17 20:18
Member 1329440817-Jul-17 20:18 
AnswerRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier17-Jul-17 21:33
mveRalf Meier17-Jul-17 21:33 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440828-Jul-17 0:25
Member 1329440828-Jul-17 0:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.