Go through this logic. If you are adding data then this will help.
DataTable table = new DataTable();
table.Columns.Add("From", typeof(int));
table.Columns.Add("To", typeof(int));
for (int i = 1; i < 10; i++)
{
table.Rows.Add(i, i + 1);
i++;
}
GridView1.DataSource = table;
If you are getting data from database then please elaborate some more.