Create directory listing

kusanagivn

New Member
I've created a directory listing using the code below, but I don't want to display every property of the file that's in the directory. How can I limit it to show only 3 (Name, Length, and CreationTime) of the 9 properties?<BR><BR>Dim dir As New DirectoryInfo(Server.MapPath("SFTNews"))<BR>Dim f As FileInfo<BR><BR>If dir.Exists Then<BR> dgrFiles.DataSource() = dir.GetFiles()<BR> dgrFiles.DataBind()<BR>End If<BR><BR>in your aspx, use databound columns<BR><BR><BR><asp:datagrid id="dgrFiles" autogeneratecolumns="false"><BR><columns><BR><asp:boundcolumn datafield="filename" headertext="asdf"/><BR></columns><BR></asp:datagrid><BR><BR>add a boundcolumn for each column you want represented in your datagrid.. datafield="x" where x=the property name..
 
Back
Top