I have ultra combo-box control in my form.It populates values as dropdown (Grid form) as I click on it. But , as soon as I click anywhere in application or click on minimzed window in task bar , the ultra combo-box will close ,even if I dnt choose any of the values in combo-box. i would like to make it static till user chooses any one of value in ultra combo-box..
Please suggestn me solution for problem asap..
Setting e.Cancel to true true prevents the user from leaving the control. I thought that's what you wanted.
There's no way to stop the control from closing up without keeping focus.
Hi Mike, The answer you suggested is not working..After execution of "e.cancel =true" statement , none of the controls on form are working :-(
The Validating event is not specific to Infragistics controls. It's an event on Control, so it's handled by the DotNet framework. I'm sure Microsoft has documentation and samples on how to use it. It's pretty simple.
private void ultraCombo1_Validating(object sender, CancelEventArgs e) { UltraCombo combo = (UltraCombo)sender; if (combo.Value == null) e.Cancel = true; }
Thanks for reply , mike.. and yah, you are right, I dont want to allow user to leave the control until they pick something. Can you suggest me , how can I handle validating event of control for this and cance the value when null?? . It would be better, if you can write few lines of code for this
Hi,
I'm not sure I understand what you are asking. It's standard behavior for any ComboBox to close when it loses focus.
Are you saying that you don't want to allow the user to leave the control until they pick something? In that case, you would probably need to handle the Validating event of the control and cancel it while the Value is null.