Hey all,
I've got a gridview on my page that displays release ntoes for out website. One of the issues I'm having is I have a Download button on each row to be able to download the release note....but if the release note does not contain a path for the file (path info stored in the DB) I do not want the download button to appear. Here's the grid:
I probably have to do something in the OnRowCreated event or similar, but don't know where to being.
Any help is appreicated!
I've got a gridview on my page that displays release ntoes for out website. One of the issues I'm having is I have a Download button on each row to be able to download the release note....but if the release note does not contain a path for the file (path info stored in the DB) I do not want the download button to appear. Here's the grid:
Code:
<asp:Panel ID="pnlFileDownloads" Width="100%" runat="server">
<asp:GridView ID="gvWebsiteReleaseNotes" DataKeyNames="ReleaseNoteLink"
runat="server" AutoGenerateColumns="false"
DataSourceID="objDS" AllowPaging="true"
onrowcommand="gvWebsiteReleaseNotes_RowCommand"
onrowcreated="gvWebsiteReleaseNotes_RowCreated">
<Columns>
<asp:BoundField DataField="Parameter" Visible="False" />
<asp:ButtonField ButtonType="Button" Text="Download" CommandName="DLFile">
<ControlStyle CssClass="GridButtons" />
</asp:ButtonField>
<asp:TemplateField HeaderText="Release Date" ItemStyle-Wrap="true">
<ItemTemplate>
<asp:Label runat="server" ID="lblReleaseDate"><%# DataBinder.Eval(Container.DataItem, "ReleaseDate") %></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Website Version" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label runat="server" ID="lblWebsiteVersion"><%# DataBinder.Eval(Container.DataItem, "WebsiteVersion") %> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Brief Description">
<ItemTemplate>
<asp:Label runat="server" ID="lblDescription"><%# DataBinder.Eval(Container.DataItem, "Description")%></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="objDS" TypeName="SCMaster" SelectMethod="GetWebsiteReleaseNotes" />
I probably have to do something in the OnRowCreated event or similar, but don't know where to being.
Any help is appreicated!