add radcombobox as child of menuitem

6 posts, 0 answers
  1. xuan
    xuan avatar
    1 posts
    Member since:
    Nov 2010

    Posted 30 Nov 2010 Link to this post

    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>
  2. George
    Admin
    George avatar
    1332 posts

    Posted 03 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Mark
    Mark avatar
    11 posts
    Member since:
    May 2012

    Posted 04 Oct 2012 Link to this post

    I am still experiencing this problem with most recent release, is telerik still working on fixing this?
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 05 Oct 2012 Link to this post

    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.

  6. Mark
    Mark avatar
    11 posts
    Member since:
    May 2012

    Posted 05 Oct 2012 Link to this post

    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 />
  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 08 Oct 2012 Link to this post

    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.

Back to Top
DevCraft banner