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
3455
Display member and value member, for a textbox cell
posted

Hi,

In my application I have a cell which is TextBox style. This cell accept only numbers and if the user enter 0 (zero) the cell must show 'None' instead of zero for any other numeric values it must show the user entered value.

How can we implement this easily.

Regards,

Ceaser

  • 469350
    Suggested Answer
    Offline posted

    Hi Caesar,

    You could handle the KeyDown event of the grid to stop the user from entering anything but numeric characters.

    Another option would be to use a Mask, but it sounds like you don't want that.

    To translate 0 into "None", you could use a ValueList in the cell. But that might be a little weird, since it only needs one item in it. Unless you know all the possible numeric values the cell can accept. Is there a limited range of values, like 0 to 10? Or can it be any number?

    If it's limited, then I recommend the ValueList.

    If not, then your best bet is probably to use a DataFilter.