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
685
How Retain focus on to the Cell in wingrid :AfterCellUpdate/BeforeRowUpdate/AfterRowUpdate events
posted

Hi All,

I am facing a issue while and updatating/Adding any rows in my grid

-- problem  -- while updating any cell text  in  AfterCellUpdate/BeforeRowUpdate/AfterRowUpdate events, i have putten custom validation check on cell so ,incase validation is incorrect it shows me message box and on press of OK button ,it chage the focus to next cell .where as i want the focus to retain on the same cell if validation is not correct

Note :-

AfterCellUpdate - Validating Cell with Custom Logic

BeforeRowUpdate -Using For Add

AfterRowUpdate - Using for Update

Example : in wingrid has a default feature like if you add some text to a integer field on grid ,it auto validates and showing the popup and on press of ok ,it focous to the same cell .

Thanks

Parents
No Data
Reply
  • 37774
    Suggested Answer
    posted

    It would be much simpler for you to use the BeforeExitEditMode event of the grid and check the ActiveCell's value, cancelling the event if it does not pass validation.  If you don't want to do this validation until later, you could check the BeforeRowDeactivate event and do your logic here; this might be better if you want to do validation on the entire row at once instead of each cell at a time.

    -Matt

Children