How to keep the combobox open while handling interior clicks

4 posts, 0 answers
  1. Eric Kemp
    Eric Kemp avatar
    109 posts
    Member since:
    Mar 2004

    Posted 04 Jul 2006 Link to this post

    Requirements

    r.a.d.controls version

    2.3

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    C#

    browser support

    all browsers supported by r.a.d.controls



    PROJECT DESCRIPTION

    The enclosed code demonstrates how to keep the combobox open until a click is made outside of the drop down panel. This behavior greatly enhances the usability of templated controls, such as an embedded treeview, which would normally cause the combobox to close every time a node is expanded or collapsed.

    The technique involves the toggling of a global variable via two wrapper divs and an evaluation of the state of the toggle in the OnClientDropDownClosing handler.
  2. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 06 Jul 2006 Link to this post

    Hi Eric,

    Thanks for the provided files and the efforts you put in preparing a sample project for us. I was able to run it on my side and it worked as expected. 1000 telerik points go to your account for your involvement.

    Your project is uploaded to our code library section.

    Greetings,
    Nick
    the telerik team
  3. Eric Kemp
    Eric Kemp avatar
    109 posts
    Member since:
    Mar 2004

    Posted 06 Jul 2006 Link to this post

    Thanks for posting this. I hope others find it useful.

    I'll be the first to admit that the technique is a bit of a hack. Please consider my submission a vote for having this as a native option feature in a future release.

    Thanks,
    Eric
  4. somedave
    somedave avatar
    9 posts
    Member since:
    Jul 2007

    Posted 18 Jul 2007 Link to this post

    Thanks for the technique. I noticed another technique from this thread that does the same thing but may be a little simpler in some cases:
    http://www.telerik.com/community/forums/reply/b313S-emteh-b313K-a.aspx

    I got a tree to work inside the template with the following code:

                                    <radC:RadComboBox ID="ContactsComboBox" runat="server" SkinsPath="~/RadControls/ComboBox/Skins" Width="150px">  
                                        <ItemTemplate> 
                                            <div onclick="event.cancelBubble=true">  
                                                <radT:RadTreeView ID="RadTreeView1" runat="server" DataFieldID="ContactID" DataFieldParentID="ParentID" 
                                                    DataSourceID="ContactsDataSource" DataTextField="Name" DataValueField="ContactID">  
                                                </radT:RadTreeView> 
                                            </div> 
                                        </ItemTemplate> 
                                        <Items> 
                                            <radC:RadComboBoxItem runat="server" Text="ContactsComboBoxItem1" /> 
                                        </Items> 
                                    </radC:RadComboBox> 
Back to Top