G
Guest
I have a Gridview ItemTemplate which displays company info as follows
<ItemTemplate>
<asp:Label ID="WEmployerLabel" runat="server" Text='<%# Bind("Employer")
%>'></asp:Label><br />
<asp:Label ID="WAddress1Label" runat="server" Text='<%#
Bind("WAddress1") %>'></asp:Label><br />
<asp:Label ID="WCityLabel" runat="server" Text='<%# Bind("WCity")
%>'></asp:Label><br />
<asp:Label ID="WPhoneTextLabel" runat="server" Text="Phone:
"></asp:Label><asp:Label ID="WPhoneLabel" runat="server" Text='<%#
Bind("WPhone") %>'></asp:Label>
</ItemTemplate>
The problem is that if a column is blank the <br/> is still appended so the
cell is taller then it needs to be and I have less space to display more
rows. And in this data there are a lot of rows one or more blank columns.
Is there any way to test if a field is blank and not include the field or
the <br /> if it is? Not sure if this can be done in the sql select statement.
Thanks for any suggestions.
<ItemTemplate>
<asp:Label ID="WEmployerLabel" runat="server" Text='<%# Bind("Employer")
%>'></asp:Label><br />
<asp:Label ID="WAddress1Label" runat="server" Text='<%#
Bind("WAddress1") %>'></asp:Label><br />
<asp:Label ID="WCityLabel" runat="server" Text='<%# Bind("WCity")
%>'></asp:Label><br />
<asp:Label ID="WPhoneTextLabel" runat="server" Text="Phone:
"></asp:Label><asp:Label ID="WPhoneLabel" runat="server" Text='<%#
Bind("WPhone") %>'></asp:Label>
</ItemTemplate>
The problem is that if a column is blank the <br/> is still appended so the
cell is taller then it needs to be and I have less space to display more
rows. And in this data there are a lot of rows one or more blank columns.
Is there any way to test if a field is blank and not include the field or
the <br /> if it is? Not sure if this can be done in the sql select statement.
Thanks for any suggestions.