This is a migrated thread and some comments may be shown as answers.

DropDownList GotFocus Event Not Working

4 Answers 168 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 26 Oct 2016, 06:08 PM

DropDownList GotFocus Event is not being fired. When I Change the property DropDownStyle to DropDownList then it is being fired.

The Scenario is I have a form, in it's load event i am binding the events which are lying on some other file with different fields. Events are GotFocus and Lost Focus  to behave identically when control got focus or lost focus, i made a common event handler and bind that handle with all fields on form load time. all fields are working well but DropDownList control works only when i change its DropDownStyle property to DropDownList. 

 I dont know why its behaving like this did i miss something ??

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 27 Oct 2016, 10:04 AM
Hello,

Thank you for writing.

I was not able to reproduce the observed behavior on my end. For convenience, I prepared a small sample, based on the information that you provided so far and attached it to this thread. Could you please check it and let me know what I need to change in order to reproduce this? 

Thank you in advance for your patience and cooperation. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Muhammad
Top achievements
Rank 1
answered on 27 Oct 2016, 08:39 PM

I make the necessary changes 

kindly rename the file from 1070932.jpg to 1070932.jpg and extract the files in to your project folder 

kindly see the CommonEventHandler Class

Kindly Change the property DropDownStyle of DropDownList From DropDown to DropDownList and vise versa and see the behavior.

Regards

 

0
Muhammad
Top achievements
Rank 1
answered on 27 Oct 2016, 08:53 PM
convert into .rar mistakenly i wrote 1070932.jpg 
0
Accepted
Dimitar
Telerik team
answered on 28 Oct 2016, 06:27 AM
Hi Muhammad,

When the DropDownStyle is set to DropDown the DropDownList is hosting a TextBox inside it. And in this case, the TextBox is gaining the focus. So when the TextBox gains the focus the BackColor of the DropDownList s reset. I have attached an updated version of the CommonEventHandler which shows how you can handle this.

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
DropDownList
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Muhammad
Top achievements
Rank 1
Share this question
or