سلام این کد رو برای نمایش نوشتم ولی تمام فیل را در یک ستون نمایش میده برای نمایش ستونهای مجزا راهنمایی بفرمایید خیلی گشتم نتیجه نگرفتم
System.IO.StreamReader file = new System.IO.StreamReader(Application.StartupPath + @"\index.txt"); string[] columnnames = file.ReadLine().Split(' ');
DataTable dt = new DataTable();
foreach (string c in columnnames)
{
dt.Columns.Add(c);
}
string newline;
while ((newline = file.ReadLine()) != null)
{
DataRow dr = dt.NewRow();
string[] values = newline.Split(' ');
for (int i = 0; i < values.Length; i++)
{
dr[i] = values[i];
}
dt.Rows.Add(dr);
}
file.Close();
dataGridView1.DataSource = dt;