RadListBox with shift + Ctrl + back arrow

2 posts, 0 answers
  1. Wayne Keet
    Wayne Keet avatar
    4 posts
    Member since:
    May 2010

    Posted 07 Apr 2011 Link to this post

    Hi,

    We are currently using a RadListbox in our software as follow:

    <telerik:RadListBox ID="MyListBox" runat="server" OnItemDataBound="BindMyItems" EnableDragAndDrop="false" AutoPostBackOnReorder="true" 
    AllowReorder="true" OnReordering="ReOrderMyItems" ViewStateMode="Disabled">
    <ItemTemplate>
    <telerik:RadTextBox ID="MyTextBox" runat="server" />
    </ItemTemplate>
    </telerik:RadListbox>


    My challenge is, when the RadTextBox has got focus and we press shit+ctrl+ <- (back arrow) for selecting the text in the RadTextBox the RadTextBox are removed from the RadListBox. We have a client KeyPress event on the RadTextBox that is added in the codebehind. When this combination of keys are pressed the KeyPress event is triggered, but I get the ctrl key and then the shift key and that is it. It seems like I am not able to catch the combination of the keypress and therefore I am struggling a bit preventing the RadTextBox from being removed

    This is how I add the KeyPress event in the codebehing, I am adding it in the BindMyItems(); For IE I am using onkeydown and other browsers I am using onkeypress.
    Code behind adding of attribute : MyTextBox.Attributes.Add(lBrowser.Browser == "IE" ? "onkeydown" : "onkeypress", "return MyKeyPressEvent(this, event)");


    My Question is, is there a way of catching this keypress combination to prevent this from happening?

    Kind Regards,
    David.
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 08 Apr 2011 Link to this post

    Hello David,

    We believe the following code solves the problem:

    Telerik.Web.UI.RadListBox.prototype._canTransfer: function(e) {
                if(this.get_allowTransfer())
                    return this.get_transferTo() != null;
                  
                return false;
            }

    Regards,
    Helen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top