Substituting 0 with empty string

  • Thread starter Anders K. Jacobsen [DK]
  • Start date
A

Anders K. Jacobsen [DK]

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
 
E

Eliyahu Goldin

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
 

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

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top