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

Avoid Button Click close DropDown content in DropDownButton

6 Answers 252 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 30 Mar 2011, 11:00 AM
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.

6 Answers, 1 is accepted

Sort by
0
Daní
Top achievements
Rank 1
answered on 01 Apr 2011, 10:38 AM
Hi,

Any help?
0
Accepted
Petar Mladenov
Telerik team
answered on 04 Apr 2011, 01:14 PM
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
0
Daní
Top achievements
Rank 1
answered on 04 Apr 2011, 02:14 PM
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
0
Daní
Top achievements
Rank 1
answered on 06 Apr 2011, 06:10 PM
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.
0
Petar Mladenov
Telerik team
answered on 07 Apr 2011, 04:03 PM
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
0
Daní
Top achievements
Rank 1
answered on 08 Apr 2011, 08:51 AM
Hello Petar,

Thanks, is working fine.
Tags
Buttons
Asked by
Daní
Top achievements
Rank 1
Answers by
Daní
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or