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

RadListBox with TextBox in ItemTemplate

3 Answers 241 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
radfreak
Top achievements
Rank 1
radfreak asked on 11 Dec 2010, 05:12 AM
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!

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 15 Dec 2010, 04:37 PM
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.
0
radfreak
Top achievements
Rank 1
answered on 15 Dec 2010, 07:45 PM
Version: Telerik.Web.UI.dll - 2010.2.929.20

Was this fixed in the Q3 version?
0
Genady Sergeev
Telerik team
answered on 21 Dec 2010, 12:07 PM
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.
Tags
ListBox
Asked by
radfreak
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
radfreak
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or