how to trap event1 when event2 is firing first ? how to override event2 ? (VS2013 - winform)

  • Thread starter Thread starter Rich P123
  • Start date Start date
R

Rich P123

Guest
In a winform application (VS2013) I have a datagridview control and a button. On the datagridview control I invoke the cellvalidating event and set e.cancel = true to prevent leaving a cell that was entered as empty (devoid of data). More specifically, if I enter valid data into a given cell on the datagridview - I leave the cell and then return to the cell and delete the entered value) -- if I do not enter anymore valid data into the cell but I try leaving the cell -- the cellvalidating event keeps bringing up my messagebox that I must enter something into this cell before leaving. I want to override this behavior when I click on the button:

pseudo code

if (btn1.Clicked == true)
dont e.cancel if given cell is empty
else
e.cancel if given cell is empty

The cellvalidating even occurs before the btn1.clicked event fires. How can I override this behavior?



Rich P

Continue reading...
 
Back
Top