How to create a table with DataGridViwer and get TXT data

0

Hello, I just migrated from C to C #. I learned some things from C # by seeing the compiler error messages.

What I want to do is to have Datagrid look the way the image is:

Link.

Well, I need exactly that. How to get the data from txt I already know, I just want to know how to send it to Datagrid.

if(OpenFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)  
             {  


                     StreamReader str = new StreamReader(OpenFileDialog1.FileName);


                    string line = "" ;


                    while ((line = str.ReadLine()) != null)
                    {
                     if (line.Contains("22="))
                     t22.Text = line.Substring(3);
                    }
                }

This code searches for "22=" in the txt file and takes what is after the "=" and colaca in the textbox I made as an example, in case I want to go to the grid. In the file txt has the data that should go to each cell, "00 = a" and breaks the line "01 = b" and goes until it reaches "ff=". Want to do this for the datagrid. In the image has the line from 0 to f and column from 0 to ff, the cells are "00, 01, 02 ... 11, 12 ... f1, f2 ...". I think you can understand what I need.

Thanks for the help.

    
asked by anonymous 17.10.2018 / 19:29

0 answers