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

add radcombobox as child of menuitem

5 Answers 96 Views
Menu
This is a migrated thread and some comments may be shown as answers.
xuan
Top achievements
Rank 1
xuan asked on 01 Dec 2010, 01:58 AM
I am adding RadComboBox as child of RadMenuItem. the code is at the end of post. the issue is: when I open combobox and move mouse to item (item1) in droplist of combobox, the menu will be closed but drop list of combo box is sitll open.  Note that clicktoopen="false" in my example. I expect menu will not be closed in this scenario.


silverlight 4:
tekerik.windows.controls.navigation 2010.2.924.1040.

                            <TextBox Width="200"   VerticalAlignment="Top">
                                <telerik:RadContextMenu.ContextMenu>
                                    <telerik:RadContextMenu ClickToOpen="False" EventName="MouseEnter" LostFocus="RadContextMenu_LostFocus" LostMouseCapture="RadContextMenu_LostMouseCapture"   >
                                        <telerik:RadMenuItem Header="Paste">
                                            <StackPanel  Orientation="Horizontal">
                                                <telerik:RadComboBox>
                                                    <telerik:RadComboBoxItem Content="Item 1"/>
                                                    <telerik:RadComboBoxItem Content="Item 2"/>
                                                </telerik:RadComboBox>
                                                <telerik:RadComboBox>
                                                    <telerik:RadComboBoxItem Content="Item 1"/>
                                                    <telerik:RadComboBoxItem Content="Item 2"/>
                                                </telerik:RadComboBox>
                                                <telerik:RadButton Content="click me"  Click="browser_Click"/>
                                            </StackPanel>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem Header="Copy"/>
                                    </telerik:RadContextMenu>
                                </telerik:RadContextMenu.ContextMenu>
                            </TextBox>

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 03 Dec 2010, 01:32 PM
Hello,

We reproduced the issue. Thank you for reporting this bug, it helps us in improving our products. I am glad to update your telerik points for reporting this abnormal behavior of our RadMenu control. We will investigate the cause for this issue and we will fix it in one of our future releases. You can track this progress in our Public Issue Tracking System (PITS) with Issue ID = 4245.

To work around it, I would suggest you to set ClickToOpen to True. I hope this helps. 


Greetings,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Mark
Top achievements
Rank 1
answered on 04 Oct 2012, 08:05 PM
I am still experiencing this problem with most recent release, is telerik still working on fixing this?
0
Rosen Vladimirov
Telerik team
answered on 05 Oct 2012, 02:53 PM
Hello Mark,

You have to set ClickToOpen = "True" for your RadMenu - this is the only way to use RadComboBox in RadMenuItem. It is designed to work this way. The problem is that when you are not using ClickToOpen property it gets False value and when you move over RadMenuItem it opens its children. When you leave the Popup, showing the RadMenuItem's children, it will be closed. The RadComboBox has its own popup to show its children. When you click on the RadComboBox and move the mouse over its children, practically you get out of the RadContextMenu and that's why it is closed. Setting ClickToOpen to false is preventing closing of RadMenuItem's children when the mouse is not over the popup holding them.

Hopefully this explanation helps.

Greetings,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mark
Top achievements
Rank 1
answered on 05 Oct 2012, 03:47 PM

I have tried to sete ClickToOpen both to true or false, but still have the problem, see images for my problem, also my code block


<%@ Register TagPrefix="ucCheckComboBox" TagName="ucccb" Src="~/Inventory/Sample_CheckComboBox.ascx" %>
         
 
<telerik:RadContextMenu ID="rcmCheckCombo" runat="server" ClickToOpen="true">
            <ItemTemplate>
                <ucCheckComboBox:ucccb runat="server" />
            </ItemTemplate>
            <Items>
                <telerik:RadMenuItem></telerik:RadMenuItem>
            </Items>
        </telerik:RadContextMenu>
 
Here is my user control definition which contains radcombobox
 
 
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Sample_CheckComboBox.ascx.cs" Inherits="StoneHorse3.Controls.Sample_CheckComboBox" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
<br />
<table cellpadding="0" cellspacing="1"  width="88">
    <tr>    
        <td>
            <telerik:RadButton ID="btnFilter" runat="server" Text="Apply" Width="39px" Height="25px" OnClick="btnFilter_Click" >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton>                           
        </td>       
        <td>
            <telerik:RadButton ID="btnClear" runat="server" Text="Clear" Width="39px" Height="25px" onclick="btnFilterClear_Click"  >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton
        </td>
    </tr>
    <tr >
        <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
    </tr>       
    <tr>
        <th colspan="2">
            <telerik:RadComboBox ID="cmbFieldList" runat="server" AutoPostBack="true" OnItemDataBound="cmbFieldList_ItemDataBound" Style="z-index: 9000">
            </telerik:RadComboBox>                   
            <asp:Label ID="lblFieldName"
                runat="server" Text="" Visible="false" CssClass="hiddenInfo"></asp:Label>
            <asp:Label ID="lblSectorID"
                runat="server" Text="" Visible="false" CssClass="hiddenInfo"></asp:Label>
        </th>                     
    </tr>
</table>
<br />
0
Kate
Telerik team
answered on 08 Oct 2012, 02:26 PM
Hi Mark,

The issue that I could replicate from my side ( I used the ASP.NET AJAX controls) occurred once I started clicking on the checkboxes of the RadComboBoxItems. To workaround the issue that you get you could the use the following events and prevent the closing of the context menu while selecting/checking RadComboBoxItems:
<script type="text/javascript">
        var radMenuContext_CanClose = true;
 
        function radMenuContext_OnClientItemClosing(sender, args) {
            args.set_cancel(!radMenuContext_CanClose);
        }
 
        function radComboBox_OnClientDropDownOpening(sender, args) {
            radMenuContext_CanClose = false;
        }
 
        function radComboBox_OnClientDropDownClosing(sender, args) {
            radMenuContext_CanClose = true;
        }
  
    </script>

markup used:
<asp:Button runat="server" ID="button1" Text="button1" />
   <telerik:RadContextMenu ID="rcmCheckCombo" runat="server" ClickToOpen="true" OnClientHiding="radMenuContext_OnClientItemClosing">
       <Targets>
           <telerik:ContextMenuControlTarget ControlID="button1" />
       </Targets>
       <ItemTemplate>
           <table cellpadding="0" cellspacing="1" width="88">
               <tr>
                   <td>
                       <telerik:RadButton ID="btnFilter" runat="server" Text="Apply" Width="39px" Height="25px">
                           <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
                       </telerik:RadButton>
                   </td>
                   <td>
                       <telerik:RadButton ID="btnClear" runat="server" Text="Clear" Width="39px" Height="25px">
                           <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
                       </telerik:RadButton>
                   </td>
               </tr>
               <tr>
                   <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
               </tr>
               <tr>
                   <th colspan="2">
                       <telerik:RadComboBox ID="cmbFieldList" runat="server" CheckBoxes="true" AutoPostBack="true"
                           OnClientDropDownClosing="radComboBox_OnClientDropDownClosing" OnClientDropDownOpening="radComboBox_OnClientDropDownOpening"
                           Style="z-index: 9000">
                           <Items>
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                               <telerik:RadComboBoxItem Text="item1" />
                           </Items>
                       </telerik:RadComboBox>
                       <asp:Label ID="lblFieldName" runat="server" Text="" Visible="false" CssClass="hiddenInfo"></asp:Label>
                       <asp:Label ID="lblSectorID" runat="server" Text="" Visible="false" CssClass="hiddenInfo"></asp:Label>
                   </th>
               </tr>
           </table>
       </ItemTemplate>
       <Items>
           <telerik:RadMenuItem>
           </telerik:RadMenuItem>
         </Items>
   </telerik:RadContextMenu>

Regards,
Kate
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Menu
Asked by
xuan
Top achievements
Rank 1
Answers by
George
Telerik team
Mark
Top achievements
Rank 1
Rosen Vladimirov
Telerik team
Kate
Telerik team
Share this question
or