DetailsView ASP Control and an empty field not an empty record.

B

ButlerDJIAM

I have pasted code I have in an ASPx page and I want to know how to make it
not display a field that is empty.
There does not seem to be anything online (MSDN) that explains it.

Usually the alt phone number would be empty and I do not want it displayed

Any suggestions would be appreciated.

<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
AutoGenerateRows="False"
BorderColor="#336666" BorderStyle="Double" BorderWidth="3px"
Width="400px"
CellPadding="4" DataSourceID="SqlDataSource1"
GridLines="Horizontal" Height="50px"
HorizontalAlign="Center">
<FooterStyle BackColor="White" ForeColor="#333333" />
<EditRowStyle BackColor="#CCCC99" Font-Bold="True" ForeColor="#333333"
/>
<RowStyle BackColor="#CCCC99" ForeColor="#333333" />
<PagerStyle BackColor="#CCCC99" ForeColor="#333333"
HorizontalAlign="Center" />
<Fields>
<asp:BoundField DataField="Pastor" HeaderText="Pastor"
SortExpression="Pastor" />
<asp:BoundField DataField="Address" HeaderText="Address"
SortExpression="Address" />
<asp:BoundField DataField="CityStateZip" HeaderText="City State Zip"
SortExpression="CityStateZip" />
<asp:BoundField DataField="Phone1" HeaderText="Phone"
SortExpression="Phone1" />
<asp:BoundField DataField="Phone2" HeaderText="Alt Phone"
SortExpression="Phone2" />
<asp:BoundField DataField="FirstService" HeaderText="First Service"
SortExpression="FirstService" />
<asp:BoundField DataField="SecService" HeaderText="Second Service"
SortExpression="SecService" />
<asp:BoundField DataField="ThirdService" HeaderText="Third Service"
SortExpression="ThirdService" />
<asp:BoundField DataField="FourthService" HeaderText="Fourth Service"
SortExpression="FourthService" />
<asp:BoundField DataField="FifthService" HeaderText="Fifth Service"
SortExpression="FifthService" />
</Fields>
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>

Thanks in advance
Darrin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,039
Messages
2,570,376
Members
47,026
Latest member
TishaMadri

Latest Threads

Top