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

Discussion in 'ASP .Net' started by ButlerDJIAM, Nov 9, 2006.

  1. ButlerDJIAM

    ButlerDJIAM Guest

    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
     
    ButlerDJIAM, Nov 9, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. deneushasler
    Replies:
    3
    Views:
    431
    deneushasler
    Jul 3, 2008
  2. Frits van Soldt

    How to insert a new record in detailsview when there are no record

    Frits van Soldt, Nov 16, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    785
    Frits van Soldt
    Nov 17, 2005
  3. Feege
    Replies:
    0
    Views:
    485
    Feege
    Dec 20, 2005
  4. Inna
    Replies:
    0
    Views:
    1,361
  5. Sound
    Replies:
    2
    Views:
    465
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page