D
desmoduck
Hey Group,
I may just be suffering brain fade but I have searched around and not
been able to find a solution. My difficulty: I have a datagrid that
shows name, address, tel, fax and toll free number. I would like to
hide the empty values. For instance; no fax = no fax number row, no
toll free = no TF row. I'm sure it must be something I am overlooking
or not thinking through.
All I can give back is my gratitude.....
<asp:datagrid AllowCustomPaging="true" AllowPaging="true"
AutoGenerateColumns="false" DataSource="<%# listings.DefaultView %>"
id="dgListings" PagerStyle-Mode="NextPrev" PageSize="<%#
listings.PageSize %>" runat="server"
OnPageIndexChanged="listings.OnDataGridPageIndexChanged"
virtualitemcount="<%# listings.RecordCount %>">
<Columns>
<asp:BoundColumn DataField="Business Category"
HeaderText="Business Category"
ReadOnly="true"
Visible="False"/>
<asp:TemplateColumn HeaderText="Business Information">
<ItemTemplate>
<table border="0">
<tr>
<td align="right"><b>Name:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Business
Name") %> </td>
</tr>
<tr>
<td align="right"><b>Address:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Address")
%> </td>
</tr>
<tr>
<td align="right"></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Town") %>,
<%# DataBinder.Eval(Container.DataItem, "State") %> <%#
DataBinder.Eval(Container.DataItem, "ZipCode") %> </td>
</tr>
<tr>
<td align="right"><b>Telephone:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "WorkPhone")
%> </td>
</tr>
<tr>
<td align="right"><b>Fax:</b> </td>
<td> <%# DataBinder.Eval(Container.DataItem, "FaxNumber")
%> </td>
</tr>
<tr>
<td aligh="right"><b>Toll Free:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "TollFree")
%> </td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn> </Columns>
</asp:datagrid>
*******************************************************
they have the internet on computers now?!?
*******************************************************
I may just be suffering brain fade but I have searched around and not
been able to find a solution. My difficulty: I have a datagrid that
shows name, address, tel, fax and toll free number. I would like to
hide the empty values. For instance; no fax = no fax number row, no
toll free = no TF row. I'm sure it must be something I am overlooking
or not thinking through.
All I can give back is my gratitude.....
<asp:datagrid AllowCustomPaging="true" AllowPaging="true"
AutoGenerateColumns="false" DataSource="<%# listings.DefaultView %>"
id="dgListings" PagerStyle-Mode="NextPrev" PageSize="<%#
listings.PageSize %>" runat="server"
OnPageIndexChanged="listings.OnDataGridPageIndexChanged"
virtualitemcount="<%# listings.RecordCount %>">
<Columns>
<asp:BoundColumn DataField="Business Category"
HeaderText="Business Category"
ReadOnly="true"
Visible="False"/>
<asp:TemplateColumn HeaderText="Business Information">
<ItemTemplate>
<table border="0">
<tr>
<td align="right"><b>Name:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Business
Name") %> </td>
</tr>
<tr>
<td align="right"><b>Address:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Address")
%> </td>
</tr>
<tr>
<td align="right"></td>
<td> <%# DataBinder.Eval(Container.DataItem, "Town") %>,
<%# DataBinder.Eval(Container.DataItem, "State") %> <%#
DataBinder.Eval(Container.DataItem, "ZipCode") %> </td>
</tr>
<tr>
<td align="right"><b>Telephone:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "WorkPhone")
%> </td>
</tr>
<tr>
<td align="right"><b>Fax:</b> </td>
<td> <%# DataBinder.Eval(Container.DataItem, "FaxNumber")
%> </td>
</tr>
<tr>
<td aligh="right"><b>Toll Free:</b></td>
<td> <%# DataBinder.Eval(Container.DataItem, "TollFree")
%> </td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn> </Columns>
</asp:datagrid>
*******************************************************
they have the internet on computers now?!?
*******************************************************