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

DropDownOpened event in DataFormComboBoxField

2 Answers 58 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
form
Top achievements
Rank 1
form asked on 19 Jun 2015, 08:25 AM

Good day, I can not find event  DropDownOpened in DataFormComboBoxField.

How to track opening?

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Jun 2015, 03:20 PM
Hello,

Indeed, DataFormComboBoxField does not expose such event. As a workaround I can suggest you the following approach. Subscribe, for example to the LayoutUpdated event of DataFormComboBoxField, and get the editor of DataFormComboBoxField, which is RadComboBox control. Then you can subscribe to its DropDownOpen or DropDownClosed events as suggested below:

private bool hasSubscribed;
 
private void DataFormComboBoxField_LayoutUpdated(object sender, EventArgs e)
{
    var combo = this.dataForm.
        ChildrenOfType<RadComboBox>().FirstOrDefault();
    if (combo != null && !hasSubscribed)
    {
        combo.DropDownOpened += combo_DropDownOpened;
        combo.DropDownClosed += combo_DropDownClosed;
        hasSubscribed = true;
    }
}

Note, that I have added a flag for the subscription, since LayoutUpdated would be raised multiple times.

Hope this helps.

Best Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
form
Top achievements
Rank 1
answered on 29 Jun 2015, 03:53 AM
Yes, thank.
Tags
DataForm
Asked by
form
Top achievements
Rank 1
Answers by
Stefan
Telerik team
form
Top achievements
Rank 1
Share this question
or