views:

99

answers:

1

Hi All,

I have a MDI child Form which displays items that are already in the database. I use a datagridview (PostedItemsDataGrid) to display the items... I also have a Button which enables user to edit the line selected in the datagridview. There are also other controls on the form other than the two controls specified.

I use a panel (Name : UpdateItemsPanel) containing various controls to edit the item selected... I want to display this form Modally... ie... When this form is active, user should not be allowed to access any controls other than the controls in the UpdateItemsPanel.

I tried the following but got into other problems... If you can help me in solve either the main or one of these problems, it would be great help.

  1. I tried putting the contents of UpdateItemsPanel in a seperate form and show it as modal... The trouble was showing the update form as modal, blocks all other MDI forms also.

  2. Other problem with this 1 is, I need to position the modalform just below the PostedItemsDataGrid... I'm not sure How to do it...

  3. I tried putting the other controls in a panel and disabling the panel when updatepanel is displayed. This ofcourse, makes the (PostedItemsDataGrid) disabled and hence unable to scroll...

Could you please help.... Please let me know, incase you need more info...

A: 

You can try Control.Validating event and set the Cancel property of the CancelEventArgs to true in the Validating event delegate.

Jacob Seleznev
Good Thought... I was trying initially trying Leave event... But it has no cancelling option... Thanks.
The King