I have the following data that I wish to import into a DataGridView
:
01-29-15 04:04AM 505758360 examplefilename1.zip
01-28-15 12:28AM 501657000 this_is_another_file.zip
01-29-15 02:27AM 1629952132 random.data.for.example.zip
This data isn't delimited by and particular number of characters or by any characters. I need to import this data into a DataGridView
, I have the following code:
public void LoadDataToGrid(string pProfile)
{
string[] lvTextData = File.ReadAllLines(Global.lvPath + @"\" + pProfile + ".txt");
DataTable dtTextData = new DataTable();
dtTextData.Columns.Add("Company Name", typeof(string));
dtTextData.Columns.Add("Size", typeof(string));
dtTextData.Columns.Add("File Name", typeof(string));
dtTextData.Columns.Add("Last Upload", typeof(string));
for(int i=1; i < lvTextData.Length; i++)
dtTextData.Rows.Add(lvTextData[i].Split());
grdData.DataSource = dtTextData;
}
The data comes in fine but only sits in one column, how can I change define the column widths?