DropDownButton not closing when clicking outside

3 posts, 0 answers
  1. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 06 Mar 2013 Link to this post

    It seems that, in some scenarios, the RadDropDownButton is not closing automatically when I click outside it.
    It fails even in this simple example:

    1. Create a new Silverlight application.
    2. Add references to Telerik.Windows.Controls.
    3. Replace Page.xaml with:
    <?xml version='1.0' encoding='utf-8' ?>
        <tk:RadDropDownButton Content="Drop down"
            <TextBlock Text="Content" />

    4. Run the application.
    If I click on the drop down button, it opens and shows its content.
    If I then click outside, the drop down button is not closed.

    What's strange is that I have used this button in other scenario and it works as wanted.

  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 08 Mar 2013 Link to this post

    Hi Patrick,

    The reason that the drop down content is not closed in this case is that the Background property of the user control (parent of the RadDropDownButton) is not set. Hence, the click event is not registered or handled. In order to overcome this issue you can set the Background property to Transparent and the code will work as expected. Let me know if you need further assistance.

    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 09 Mar 2013 Link to this post

    your solution doesn't work in this case: setting the background of the UserControl is not the solution.
    Instead, I had to put the RadDropDownButton inside a Grid and to set the background of the Grid to Transparent.
    Thanks for pointing to the right direction.
Back to Top