I am using a template column in a datagrid and I want to use different images depending on what type of file it is(PDF, Excel, Word, etc). There is a field called extenstion that has xls or pdf in it depending on which file is being used. The image url should show the image. I know the images are in the path I specify. Does anyone how to configure the template column to call the appropriate extension depending on what kind of file it is? Here is my code for the datagrid:
Code:
<asp:Datagrid ID="MonthlyDownloadsGrid" OnDeleteCommand="MonthlyDownloadsGridDelete" OnItemCreated="MonthlyDownloadsGrid_ItemDataBound" BorderWidth="2pt" BorderStyle="Double" BorderColor="Black" runat="server" AutoGenerateColumns="False"Width="728px"><Columns>
<asp:TemplateColumn HeaderStyle-BorderColor = "Black" HeaderStyle-BorderStyle ="Inset" ItemStyle-BorderColor = "Black" ItemStyle-BorderStyle="Inset" HeaderText="File Type"><ItemTemplate><asp:HyperLink ID="hlThumbnails" Target="_blank" ImageUrl='images/reports/Repdown_<%# Eval("extension") %>icon.gif' runat="server" NavigateUrl='<%# Eval("finalpath") %> '></asp:HyperLink>
</ItemTemplate></asp:TemplateColumn></Columns>