RadListBox with TextBox in ItemTemplate

4 posts, 0 answers
  1. radfreak
    radfreak avatar
    6 posts
    Member since:
    Dec 2010

    Posted 10 Dec 2010 Link to this post

    Hello, having some issues with having a TextBox in an ItemTemplate.

    First it was the text box not accepting "space" but i found the workaround in the forums.
    http://www.telerik.com/help/aspnet-ajax/listbox-space-ignored-textbox-itemtemplate.html

    Now, typing text into the textboxes creates unwanted behavior when using the "s" character. The behavior im seeing is when typing the "s" charater in the RadListBoxItem.Textbox the selection attempts a changes to the next visible list box item. the focus bounces back and forth between the visible items (I only have 2 items visible at any given time due to size contraints.). I've looked high and low on a way to disable the listbox keyboard shortcuts but found nothing.

    Im unsure how many other keyboard shortcuts are associated with this control, but since i need a textbox (well, a couple) I'd like to simply turn off keyboard support for this control.

    Heres the markup:

     

    <telerik:RadListBox runat="server" ID="listBoxSlideShowActiveItems" 
        SelectionMode="Multiple" EnableDragAndDrop="true" 
        AllowDelete="false" AllowReorder="true" Height="200px" Width="370px" AllowTransferOnDoubleClick="false">
        <ItemTemplate>  
            <fieldset>
                <legend style="font-size:8pt;padding-bottom:2px;">Slide Description</legend>
                <table border="0" width="100%">
                    <tr>
                        <td style="width:80px;" valign="top">
                            <asp:Image ID="imageActiveItemThumbnail" runat="server" CssClass="thumbnailImageSlideShowLarge" ImageUrl="~/SiteImages/spacer.gif" />
                        </td>
                        <td valign="top">
                            <table border="0" width="100%">
                                <tr>
                                    <td>Text:</td>
                                    <td><asp:TextBox ID="textActiveItemText" runat="server" Width="170"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>Href</td>
                                    <td><asp:TextBox ID="textActiveItemHref" runat="server" Width="170"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>Target:</td>
                                    <td>
                                        <telerik:RadComboBox ID="comboActiveItemTarget" runat="server" Width="178px">
                                            <Items>
                                                <telerik:RadComboBoxItem Text="_blank" Value="_blank" Selected="True" />
                                                <telerik:RadComboBoxItem Text="_parent" Value="_parent" />
                                                <telerik:RadComboBoxItem Text="_search" Value="_search" />
                                                <telerik:RadComboBoxItem Text="_self" Value="_self" />
                                                <telerik:RadComboBoxItem Text="_top" Value="_top" />
                                            </Items>
                                        </telerik:RadComboBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </ItemTemplate>
        <Items></Items>
    </telerik:RadListBox>
    <script type="text/javascript">
        // RadListBox documented workaround for textbox in item template
      
        var radListBoxKeyDown = Telerik.Web.UI.RadListBox.prototype._onKeyDown;
        Telerik.Web.UI.RadListBox.prototype._onKeyDown = function (e) {
            if (e.keyCode == Sys.UI.Key.space) {
                return;
            }
            else {
                radListBoxKeyDown.apply(this, arguments);
            }
        }
    </script>

    Thanks in advance!

  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 15 Dec 2010 Link to this post

    Hi Radfreak,


    Could you tell me the version of our controls you are using , because this has been a bug which has already been fixed.



    Greetings,
    Dimitar Terziev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. radfreak
    radfreak avatar
    6 posts
    Member since:
    Dec 2010

    Posted 15 Dec 2010 Link to this post

    Version: Telerik.Web.UI.dll - 2010.2.929.20

    Was this fixed in the Q3 version?
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 21 Dec 2010 Link to this post

    Hello radfreak,

    It turned out that the problem is different that what we originally have thought. We are now working of fixing it and the fix is going to be available together with the next week's latest internal build. More information on how to obtain the latest internal build can be found here.

    Kind regards,
    Genady Sergeev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top