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

[Solved] Disable "OnClientItemClick" event in RadComboBox into a RadContextMenu

2 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adrien C.
Top achievements
Rank 1
Adrien C. asked on 13 Oct 2009, 08:15 AM
Hi,
I'm using a RadComboBox bind by WebService wich is into a RadContextMenu ItemTemplate :

    
    <telerik:RadContextMenu ID="RCMU" runat="server" ... > 
        <Items> 
            ... 
            <telerik:RadMenuItem Value="5"
                <ItemTemplate> 
                    <telerik:RadComboBox ID="CMRDDLC" runat="server"  
                        ShowMoreResultsBox="false" EnableVirtualScrolling="true" EnableItemCaching="true"  
                        EnableTextSelection="true" EnableViewState="False"  
                        EnableLoadOnDemand="true" ZIndex="10000" 
                        OnClientItemsRequesting="OnClientItemsRequesting"
                        <WebServiceSettings  Path="~/.asmx" Method="GetMethod" /> 
                        <CollapseAnimation Duration="100" Type="OutQuint" /> 
                    </telerik:RadComboBox> 
                </ItemTemplate> 
            </telerik:RadMenuItem> 
            ... 
        </Items> 
    </telerik:RadContextMenu> 

So far, everything is going well.

But when I click on an element of the RadComboBox, the DropDownList is hidden and the context menu too, and I want the menu stays open.

I've tried codes as "set_cancel(true)" to stop the click event propagation on radComboBox but nothing works, I also tried to find wich element cause the close of the contextual menu but i haven't find methods that helps, any ideas ?


Best regards

EDIT: I'm using Q1 2009 (402.35) :)




2 Answers, 1 is accepted

Sort by
0
Adrien C.
Top achievements
Rank 1
answered on 13 Oct 2009, 01:29 PM
I found a simple way to correct this problem by including javascript functions on OnClientHiding of the RadContextMenu and OnClientDropDownClosed of the RadComboBox as below:

var KeepOpen=false
function ClientHiding(sender,eventArgs){eventArgs.set_cancel(KeepOpen);KeepOpen=false;} 
function ClientDropDownClosed(){KeepOpen=true;} 

That's not a clean solution because the events are still raised and a little bug appears (ergonomical). If there is a way to clean this part I'm interested.


0
Yana
Telerik team
answered on 15 Oct 2009, 03:21 PM
Hello Adrien,

I'm afraid that I would offer you a similar solution.

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Adrien C.
Top achievements
Rank 1
Answers by
Adrien C.
Top achievements
Rank 1
Yana
Telerik team
Share this question
or