LostFocus Event is not Fired in the MulticolumnComboBox when is DropDown

I currently have a MultiColumnComboBox in a form and I'm doing a validation of the user input on it when the control lost focus checking if the user input is a valid text of any of the items in the list, when the entry is a invalid text I show a message and returns the focus on the control in this way the control will not loss the focus unless the text is correct.

I try this of course with the LostFocus Event but this event is fired only when the DropDownStyle property is set to DropDownList but isn't when is set to DropDown and I don't know why.
I try also with the Leave Event and it works partially because is fired when the control that receives the focus is a textbox or other combobox but this event is not fired when the control is a button, and my validation code is not executed.

I actually think if the lost event will fired my problem will not exists. Can you tell me why the event is not fired or what choices have I?

1 Reply

MJ Mano J Syncfusion Team July 29, 2009 07:35 AM UTC

Hi Leonel,

When the style is DropDown, MultiColumnCombobox has an internal TextBox. Please handle LostFocus event of that textbox as shown below.


multiColumnComboBox1.TextBox.LostFocus += new EventHandler(TextBox_LostFocus);

void TextBox_LostFocus(object sender, EventArgs e)
{
// do validation here.
}


Regards,
Mano

Loader.
Up arrow icon