Substituting 0 with empty string

Discussion in 'ASP .Net Datagrid Control' started by Anders K. Jacobsen [DK], May 3, 2005.

  1. Hi i have a list of objects which I bind to a datagrid

    Some of the columns are decimal type and in the database many of the values
    are 0. But I need the zeros to beed empty string instead of 0. how could i
    easily do that?

    Anders
     
    Anders K. Jacobsen [DK], May 3, 2005
    #1
    1. Advertising

  2. Anders,

    The columns contain strings only. You can make a simple function that will
    check if the cell contains "0" and replace it to "" and databind the columns
    to this function. Alternatively you can access and change column content in
    ItemDataBound event.

    Eliyahu

    "Anders K. Jacobsen [DK]" <> wrote in message
    news:...
    > Hi i have a list of objects which I bind to a datagrid
    >
    > Some of the columns are decimal type and in the database many of the

    values
    > are 0. But I need the zeros to beed empty string instead of 0. how could i
    > easily do that?
    >
    > Anders
    >
    >
     
    Eliyahu Goldin, May 4, 2005
    #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. Andy Fish
    Replies:
    2
    Views:
    399
    Young Seeker
    Dec 29, 2003
  2. Christian Schlichtherle
    Replies:
    8
    Views:
    474
    John Currier
    Jul 5, 2005
  3. Tzury Bar Yochay
    Replies:
    1
    Views:
    406
    Gabriel Genellina
    Mar 24, 2008
  4. Savvoulidis Iordanis

    Empty gridview cells and checking for empty string

    Savvoulidis Iordanis, Sep 5, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    524
    Savvoulidis Iordanis
    Sep 5, 2008
  5. Federico ZagarzazĂș

    Error when substituting a backslash in a string

    Federico ZagarzazĂș, Jun 6, 2007, in forum: Ruby
    Replies:
    7
    Views:
    90
    Ryan Mcdonald
    Jun 7, 2007
Loading...

Share This Page