G
Guest
I am trying to dynamically add a control within an itemtemplate container in
a gridview and need some assistance.
For example, my goal is to evaluate a column's value in a datagrid row and
depending on it's value dynamically add a few hyperlink controls to within
the template field.
I'm familiar with doing this in .NET 1.1 using the itemondatabound event and
interrogating the datagrid and am looking for a similiar way to do this with
the dataview, ideally all in a similiar event.
Any help is appreciated!
<asp:TemplateField HeaderText="Converted FileName"
SortExpression="ConvertedFileName">
<ItemTemplate>
<asp:Label ID="lblConvertedFileName"
runat="server" Text='<%# Bind("ConvertedFileName") %>'></asp:Label>
<br />
<asp:HyperLink ID="hlDownloadCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Download"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlViewCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="View"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlUploadCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Upload"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlDeleteCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Delete"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
a gridview and need some assistance.
For example, my goal is to evaluate a column's value in a datagrid row and
depending on it's value dynamically add a few hyperlink controls to within
the template field.
I'm familiar with doing this in .NET 1.1 using the itemondatabound event and
interrogating the datagrid and am looking for a similiar way to do this with
the dataview, ideally all in a similiar event.
Any help is appreciated!
<asp:TemplateField HeaderText="Converted FileName"
SortExpression="ConvertedFileName">
<ItemTemplate>
<asp:Label ID="lblConvertedFileName"
runat="server" Text='<%# Bind("ConvertedFileName") %>'></asp:Label>
<br />
<asp:HyperLink ID="hlDownloadCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Download"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlViewCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="View"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlUploadCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Upload"></asp:HyperLink>
<br />
<asp:HyperLink ID="hlDeleteCFN" runat="server"
NavigateUrl="~/Admin/Admin_Bundles.aspx" Text="Delete"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>