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
340
Focus to the cell in the grid.
posted

i want to give focus to a specific column if data entered in a row is not valid.

for example, there are 3 field, code, location, quantity, code has to be entered, location has to be entered, quantity has to be more than zero.

before i exit the row, if location or quantity is not entered, i want to show the message to user 'please enter location' and after use press ok the focus go to location coloumn of the row

also in case quantity is less than zero, show message to the user 'invalid quantity' and on press of ok, focus go to quantity column of the row.

is there a way to achieve this?

thanks in advance.

Parv

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Parv,

        It think you can do this using the BeforeRowUpdate event. You can check the values in the row and if any of them are invalid, you can set e.Cancel to true and Activate the cell you want.

        You might also want to take a look at the BeforeRowUpdateCancelAction property. I'm not sure you need it, but this property determines what happens when you cancel BeforeRowUpdate.  

     

Children