tlatacki
asked on
Locking user into a DataGrid if column totals are incorrect.
I'm having an issue keeping the user from leaving a data grid if certain criteria isn't met.
I'm able to the checking on the validating event of the datagrid.
I'm having the problem if the user clicks on either a button or menu option on the parent form.
I'm not able to stop the event from executing even though I'm trapping and displaying my message.
You should use the dataset's columnChanging event. You can check the proposedvalue, then set the columnerror to track changes in the dataset and display errors in the grid.
If you want to keep them on the grid if there are errors, you can disable the other controls in either event.
i.e. if there is an error, set the columnerror and disable the controls, else set the columnerror = "" and enable the controls.
i.e. if there is an error, set the columnerror and disable the controls, else set the columnerror = "" and enable the controls.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
eozz - Works for events on the child. But events (Menu/Toolbar) are still ran.
Robert - I'm trying to see how to disable the Items on the Menu (I think I've found) - but, I haven't found the Toolbar items.
FYI - I inherited this project, so I'm also still trying to understand its functions and use.
Robert - I'm trying to see how to disable the Items on the Menu (I think I've found) - but, I haven't found the Toolbar items.
FYI - I inherited this project, so I'm also still trying to understand its functions and use.
The toolbar can be disabled by referencing the toolbar on the form.
Click on the toolbar and look at the properties window to get the name.
Then just use the following:
ToolbarName.Enabled = false
Click on the toolbar and look at the properties window to get the name.
Then just use the following:
ToolbarName.Enabled = false
ASKER
I just don't see it.
I have to use
Me.MdiParent.Menu.MenuItem
to access the MenuItems - But they don't change right away.
But i can't seem to locate the ToolBar
I haven't done much programming with Parent / Child Forms either.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.