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

RadListBox with shift + Ctrl + back arrow

1 Answer 61 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Wayne Keet
Top achievements
Rank 1
Wayne Keet asked on 07 Apr 2011, 08:40 AM
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.

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 08 Apr 2011, 04:58 PM
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
Tags
ListBox
Asked by
Wayne Keet
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or