Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to force the ComboBoxEdit to post the selected value when the Tab key is pressed

$
0
0

This example demonstrates how to create a ComboBoxEdit that posts a value selected in the popup when the Tab key is pressed.

To enable this feature, we have created a ComboBoxEdit class descendant and overridden its ProcessPopupKeyDown method. In this method, we check which key was pressed by a user (we obtain it from the KeyEventArgs.Key property). If it's "Tab", we forcibly close the popup by using the ClosePopup method:

[C#]
protectedoverrideboolProcessPopupKeyDown(KeyEventArgse){if(e.Key==Key.Tab){if(IsPopupOpen)ClosePopup(PopupCloseMode.Normal);}returnbase.ProcessPopupKeyDown(e);}
Question Comments

Added By: John Genske at: 3/25/2016 2:14:50 PM    How do you achieve the same thing in the grid column?

Viewing all articles
Browse latest Browse all 7205

Trending Articles



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