Display alternate text in datagrid

Discussion in 'ASP .Net Datagrid Control' started by Jason ., May 11, 2006.

  1. Jason .

    Jason . Guest

    I have a datagrid that has a boundcolumn to my database:

    <asp:BoundColumn DataField="IndustryPercentile" HeaderText="Industry"
    DataFormatString="{0:###}%">
    </asp:BoundColumn>

    When a IndustryPercentile value is not available, the data returned is
    -1. I would like to display "n/a" when the IndustryPercentile is -1.
    How can I do this?



    *** Sent via Developersdex http://www.developersdex.com ***
     
    Jason ., May 11, 2006
    #1
    1. Advertising

  2. Handle ItemDataBound event. If the cell text = "-1", replace it with "n/a".

    Eliyahu

    "Jason ." <> wrote in message
    news:%...
    >I have a datagrid that has a boundcolumn to my database:
    >
    > <asp:BoundColumn DataField="IndustryPercentile" HeaderText="Industry"
    > DataFormatString="{0:###}%">
    > </asp:BoundColumn>
    >
    > When a IndustryPercentile value is not available, the data returned is
    > -1. I would like to display "n/a" when the IndustryPercentile is -1.
    > How can I do this?
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    Eliyahu Goldin, May 11, 2006
    #2
    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. DotNetJunkies User

    Datagrid HeaderImageUrl - apply alternate text

    DotNetJunkies User, May 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    425
    DotNetJunkies User
    May 19, 2004
  2. =?Utf-8?B?ZHBvbXQ=?=
    Replies:
    5
    Views:
    633
    Steven Cheng[MSFT]
    Jan 17, 2006
  3. Jimbo

    java applet alternate text

    Jimbo, Mar 2, 2007, in forum: HTML
    Replies:
    3
    Views:
    419
    murari garg
    Mar 4, 2007
  4. Chris
    Replies:
    2
    Views:
    769
    Chris
    Mar 4, 2007
  5. Replies:
    10
    Views:
    356
    Sean O'Halpin
    Jul 17, 2006
Loading...

Share This Page