Please refer this link
If you want to use DataTable instead of List please refer this code.
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Name"), new DataColumn("Url") });
string[] files = System.IO.Directory.GetFiles(Server.MapPath("~/images/"), "*");
foreach (string file in files)
{
dt.Rows.Add(System.IO.Path.GetFileName(file), "~/images/" + System.IO.Path.GetFileName(file));
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
}