Sorry i did not explain properly
I am using the following code to bind a list of files to a datagrid but if
there are no folder of files the datagrid dissapears, i want a way to
check for files or folder before i bind the gird.
e.g
check for folder
if not folders, do nothing, if folders exist bind datagrid
System.IO.DirectoryInfo dicases1=new
System.IO.DirectoryInfo("C:\\Shearings\\" + jon + "\\" + folder);
DataGrid3.DataSource = dicases1.GetFiles();
DataGrid3.DataBind();
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
didocs1.GetFiles ();
didocs1.GetDirectories ();
Not sure about security issues.
Eliyahu
"Jonathan Dixon" <jo**@ukonline.co.uk> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl... I am using this code to get a list of folders and files
System.IO.DirectoryInfo didocs1=new
System.IO.DirectoryInfo("C:\\Shearings\\" + jonn + "\\" + folder);
I was wondering if there was a way to determine if the the folder had
any files or subfolders within it or whether it is empty
Thanks
Jon