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
535
WebGrid with Unbound check box +validation
posted

Hi All,

I am using ultrawebgrid with unbound checkbox column in my asp.net 2.0 c# application. It is used for accounts table. When submit happens, I need to make sure that atleast one account is selected by checking the checkbox. Otherwise, do not allow the further process.

Is there any way I can take care of it on client side or serverside other than looping through the grid rows and checking checkbox column.

I appreciate your response.

Thanks,

Katta 

 

  • 21382
    posted

    You could put a javascript variable on your page:

     

    var someoneChecked = false;

     

    And then in the client side cell update (cell value changed, I forget what the name is at the moment), check the key of the column that was updated.  If it was the key for your checkbox column, then you can check the value, see if its true and set the form variable to true.  Now you have a validation point.

     

    But depending on how many rows, it might be easier to just loop through them.