Hello all. I have a column on a datagrid which I display a hyperlink. I am doing this just fine (see code below). However, I only want to display the link when a certain database field is null. Anyone know how I can do this?
Thanks!
SteveS
Here is what I have so far:
<asp:datagrid id="dgrdServerAvail" runat="server" AutoGenerateColumns="False" GridLines="Both" BorderColor="Gray" BorderWidth="1" CellPadding="6" CellSpacing="0" EnableViewState="true">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" BackColor="LightGray"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="SRVR_CODE" Visible="False"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Check<Br>Out">
<ItemTemplate>
<center>
<asp:checkbox ID="chkCheckout" Runat="server"></asp:checkbox></center>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="SRVR_SERVER_NAME" HeaderText="Server Name"></asp:BoundColumn>
<asp:HyperLinkColumn HeaderText="Previous<Br>Checkout<br>Info" DataNavigateUrlField="COIT_CODE" DataNavigateUrlFormatString="CheckInOutDetail.aspx?id={0}" Text="view"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>
Thanks!
SteveS
Here is what I have so far:
<asp:datagrid id="dgrdServerAvail" runat="server" AutoGenerateColumns="False" GridLines="Both" BorderColor="Gray" BorderWidth="1" CellPadding="6" CellSpacing="0" EnableViewState="true">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" BackColor="LightGray"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="SRVR_CODE" Visible="False"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Check<Br>Out">
<ItemTemplate>
<center>
<asp:checkbox ID="chkCheckout" Runat="server"></asp:checkbox></center>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="SRVR_SERVER_NAME" HeaderText="Server Name"></asp:BoundColumn>
<asp:HyperLinkColumn HeaderText="Previous<Br>Checkout<br>Info" DataNavigateUrlField="COIT_CODE" DataNavigateUrlFormatString="CheckInOutDetail.aspx?id={0}" Text="view"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>