Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Need column to show nothing if value is 0
posted

I'm using some WebPercentEditProviders, but if no value has been entered it shows 0 (zero).

I would like to implement some display formatting such as {0:#.####} but the BoundDataColumn does not understand # formatting.

How can I get a column to display numbers as normal, but display nothing instead of 0 (zero). A srting column would do this but then you lose the ability to set MinValue and MaxValue and number of decimals places.

Any help much appreciated.

 

Parents
No Data
Reply
  • 13438
    posted

    Hello Christopher

    To achieve this you will have to handle the valuechanged event of the editor:
    in the WDG:
    <EditorProviders>

                    <ig:PercentEditorProvider ID="WebDataGrid1_PercentEditorProvider1" >

    <EditorControl BackColor="Red" BorderColor="Blue" ClientIDMode="Predictable">

        <ClientEvents 

            ValueChanged="ValueChanged" />

                        </EditorControl>

                    </ig:PercentEditorProvider>

                </EditorProviders>



    the event:
    function ValueChanged(sender, eventArgs)

    {

        if (eventArgs.get_value() == 0)

        {

            sender._text = "";

        }

    }

Children