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
85
How to put validation on webgrid column ?
posted

I am using a amount column in Webgrid.

I want to put a validation to the column so that it accepts only integer values.

 Also i want to display proper message to user when he enters invalid data ex- alphabets,spl chars  etc.

How can i achieve this ?

Parents
No Data
Reply
  • 592
    Verified Answer
    posted

    Hi,

    You could put the valdation at Client side by add event:

    grid_BeforeExitEditModeHandler(gridName, cellId, newValue)

    {

    if (newValue is Interger value)

    return 0; //Valid

    else

    return 1; //Invalid

    }

     

    Hope this helpfull.

Children