Quantcast
Viewing all articles
Browse latest Browse all 7205

How to modify the PopupContainerEdit reaction on the outer mouse click

By default, the RepositoryItemPopupContainerEdit.CloseOnOuterMouseClick property allows you to specify that the PopupContainerEdit should not close the pop-up window if the user clicks within another pop-up window opened by the control placed within the pop-up Form. However, there is no way to keep the pop-up window if the user clicks within the PopupContainerEdit owner Form. This example demonstrates how to create the editor inherited from the PopupContainerEdit that does not close its pop-up Form, unless the drop-down button or Escape keyboard key is pressed.

To implement this functionality, it is necessary to create a custom PopupContainerForm descendant, and override its AlllowMouseClick method. You can put any complex logic within this method to calculate whether or not the pop-up window should be closed in a certain situation. This example simply returns the True value in, any case.

See also:
How to register a custom editor for use in the XtraGrid

Question Comments

Added By: Martin Bauer 1 at: 9/7/2012 3:07:40 AM    

it doesnt help if the user does a click outside of the application. in this case the QueryResult comes to early. the bigest limitation is now you cant show modal dialogs(OpenFileDialog) from a custompopup. Sad!

Added By: Kevin Gabbert 1 at: 6/5/2015 4:38:57 PM    

CustomPopupContainerEdit does not implement ISupportInitialize, so this can't be used as a control on a form.  Nor can its popup position be set.  This makes this solution useless.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>