Avoid Button Click close DropDown content in DropDownButton

7 posts, 1 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 30 Mar 2011 Link to this post

    Hello,

    I'm using a RadRibbonDropDownButton with KeepOpen property set to false, so, whenever user cliks outside the drop dow content it closes. Inside the dropdown content I have a RadRibbonButton, clicking on this button causes a popuo to be shown, but popup never gets visible beacause RadRibbonButton clik forces the drop down to close. How can avoid the RadRibbonButton closing the dropdown content?

    thanks.
  2. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 01 Apr 2011 Link to this post

    Hi,

    Any help?
  3. DevCraft banner
  4. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 04 Apr 2011 Link to this post

    Hi Daní,

    Unfortunately, I am unable to reproduce this issue showing a MessagBox. Could you please examine my test project and let me know if I am missing something?

    Kind regards,
    Petar Mladenov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 04 Apr 2011 Link to this post

    Hi Peter,

    I meant showing a popup, a telerik popup. Please replace the DropDrownButton.DropDownContent in your example by the next xaml:
    <StackPanel>
     
                                    <Rectangle Fill="DeepSkyBlue" Width="100" Height="30" />
                                    <telerik:RadRibbonButton x:Name="ShowPopupButton" Content="Show Popup" Click="RadRibbonButton_Click"  />
     
                                    <Rectangle Fill="DeepSkyBlue" Width="100" Height="30" />
                                    <telerik:Popup x:Name="MyPopup" CloseOnOutsideClick="True" Owner="{Binding ElementName=ShowPopupButton}" Placement="Bottom">
                                        <TextBlock FontSize="32" Text="Hello World!!!" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </telerik:Popup>
                                </StackPanel>
    An on the RadRibbonButton click event handler, please replace the code by the next one:
    private void RadRibbonButton_Click(object sender, RoutedEventArgs e)
            {
                MyPopup.IsOpen = true;
                //MessageBox.Show("Popu shown!");
            }
    You will see that MyPopup never is shown. Of course, setting KeepOpen property to true on RadRibbonDropDownButton makes the popup to be shown when clicking on RadRibbonButton
  6. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 06 Apr 2011 Link to this post

    Hi Peter,

    Any advice about this issue? Or maybe what I'm trying to do is not possible and I must use a RadWindow in place the Telerik Popup?

    Thanks.
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Apr 2011 Link to this post

    Hi Daní,

    You can play with the Closed and Opened events of the Popup in conjunction with the KeepOpen property of the button like so:
    private void RadRibbonButton_Click(object sender, RoutedEventArgs e)
            {
                this.button.KeepOpen = true;
                MyPopup.IsOpen = true;
            }
      
            private void MyPopup_Opened(object sender, RoutedEventArgs e)
            {
                 
            }
      
            private void MyPopup_Closed(object sender, RoutedEventArgs e)
            {
                this.button.KeepOpen = false;
                this.button.IsOpen = false;
            }


    All the best,
    Petar Mladenov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  8. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 08 Apr 2011 Link to this post

    Hello Petar,

    Thanks, is working fine.
Back to Top
DevCraft banner