I have text file with log information from another program and it has very bad formatting but I can´t edit original program and I want create a new program with dataGridView which read data from .txt file and add it to datagridview. It´s not so hard and I made it with dataGridView1.Rows.Add and array of strings (and prepared columns before). But I don´t use datasource and dataset. I want to add filtering (combobox in header of datagridview, like here but I can´t add it without dataset. So how can I create dataset with just array of strings which has just data? I am trying this code:
DataSet ds = new DataSet();
ds.Tables.Add(TableName);
ds.Tables[TableName].Columns.Add("Datum");
ds.Tables[TableName].Columns.Add("Cas");
ds.Tables[TableName].Columns.Add("Moduly");
Then I read everyline in file and create array with strings and try add that array to row:
ds.Tables[TableName].Rows.Add(PoleRetezcu);
And then just add DataSet do datagridview but it wont work:
dataGridView1.DataSource = ds;
Thank you for help