Blank if Zero

2 posts, 0 answers
  1. Joe
    Joe avatar
    2 posts
    Member since:
    Feb 2011

    Posted 27 Jul 2012 Link to this post

    Is there a way to have the RadNumericUpDown to not display the value if it is 0? (or 0.0)
  2. Joe
    Joe avatar
    2 posts
    Member since:
    Feb 2011

    Posted 27 Jul 2012 Link to this post

    As is most often the case after banging one's head into the wall for a few hours and making no progress, then you humble yourself to ask for help... and suddenly the light bulb goes on!

    I was trying to look for an answer working with the control, but with how it formats numbers for display I couldn't ride a wave for a solution.

    so I stuck a crowbar into the control and extended it:
    public class RRNumericUpDown :RadNumericUpDown
        {
            public override string FormatDisplay()
            {
                if (this.Value == 0.0d)
                {
                    return "";
                }
                return base.FormatDisplay();
            }
     
        }

    Hope this helps others looking for a similar solution.
  3. DevCraft banner
Back to Top