Checking negative values in a DataGridView

Hi there,

I have one dataGridView and there are some columns. I'm using DataGridView to capture some values and one of the column can accept either whole numbers or decimal values.
What i do want to check it - sign or negative value as I don't want the user to input any - value.
Is there any way to do it

Thanks in advance

Bye




Answer this question

Checking negative values in a DataGridView

  • Chris Wilson

    Hi

    Check out the System.Math.Sign function ... it returns -1 for negative values, 1 for positive and 0 for zero.

    Richard


  • Checking negative values in a DataGridView