can some one tell me how to iterate through a direcotries and sub directories by selecting a directory ro in a grid i got the in fo in the grid like this but cant seem to figure out the selected index change or something its killing me,
this is what i have so far
protected void Page_Load(object sender, EventArgs e)
{
DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory);
DataTable dtFileInfo = new DataTable();
string StartingDir = @"C:\";
txtCurrentDir.Text =
"Current Directory" + " " + StartingDir;
//Create the headers
dtFileInfo.Columns.Add(
"Name");
dtFileInfo.Columns.Add(
"Extension");
dtFileInfo.Columns.Add(
"Size");
dtFileInfo.Columns.Add(
"Last Modified");
//add columns
foreach (FileInfo f in di.GetFiles())
{
DataRow drFile = dtFileInfo.NewRow();
drFile[
"Name"] = f.FullName;
drFile[
"Extension"] = f.Extension;
drFile[
"Size"] = f.Length;
drFile[
"Last Modified"] = f.LastAccessTime;
dtFileInfo.Rows.Add(drFile);
//Bind to the grid
GridView1.DataSource = dtFileInfo;
GridView1.DataBind();
}