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

RadListBox Issue with IE 11

12 Answers 73 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Afroz khan
Top achievements
Rank 1
Afroz khan asked on 18 Aug 2015, 03:28 PM

Hello Team,

Recently I upgraded ,telerik control(2015, 2, 623, 40) to make compatible for IE 11 but after upgrading the telerik control ,getting unexpected behavior for control

I am using telerik RadListBox along with RadContextMenu ,also RadListBox  having postback on selection of the record .But when I do right click to open the contextmenu then postback event getting fire and not able to select the context menu.

I will appreciate ,if I get the early response , because it urgent need for business

here is code sample

-----------------------------------------------------------------------------------------------------------------------

HTML

<telerik:RadListBox ID="rdListDocumentTypes" Skin="Outlook" Height="150px" Width="305px"
AllowReorder="true" AllowDelete="true" OnClientSelectedIndexChanged="DirtyTrackListBox"
OnClientContextMenu="showContextMenuOnDocumentType" SelectionMode="Single" AutoPostBack="true"
runat="server">
<ButtonSettings ShowDelete="false" ShowReorder="false" />
</telerik:RadListBox>
<telerik:RadContextMenu ID="contextMenuDocumentTypes" runat="server" OnClientItemClicking="OnClientDocumentTypeDelete"
Skin="Outlook" OnClientItemClicked="onItemClickedOnDocumentType" Style="top: 298px;
left: 12px">
<Items>
<telerik:RadMenuItem Text="Delete" Value="Delete" />
</Items>
</telerik:RadContextMenu>

 

------------------------------------------------------------------------

JavaScript

 

function OnClientDocumentTypeDelete(sender, eventArgs)
{
if (eventArgs.get_item().get_value() == "Delete")
{
if (!confirm('Are you sure you want to delete this record?'))
{
eventArgs.set_cancel(true);
return false;
}
ResetDirty(sender._element);
return true;
}
return false;
}
function showContextMenuOnDocumentType(sender, e)
{
var menu = $find("<%=contextMenuDocumentTypes.ClientID %>");
if (menu == null) return;
var rawEvent = e.get_domEvent().rawEvent;
if (e.get_item() != null)
{
menu.show(rawEvent);
e.get_item().select();
}
$telerik.cancelRawEvent(rawEvent);
}
function onItemClickedOnDocumentType(sender, e)
{
var listBox = $find("<%=rdListDocumentTypes.ClientID %>");
var index = listBox._selectedIndices[0];
var id = listBox._itemData[index].value;
document.getElementById("<%=hdfSelectedDocumentType.ClientID %>").value = id;
}

12 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 21 Aug 2015, 08:56 AM
Hello,

The postback is caused by the posted below line of code in your showContextMenuOnDocumentType handler, which selects the item you have right-clicked on and since the RadListBox' AutoPostBack property is set to "true" the item selection posts the page:
e.get_item().select();

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Afroz khan
Top achievements
Rank 1
answered on 21 Aug 2015, 09:26 AM

Hello Ivan,

Its true , but unexpected result ,which is coming from Listbox, was not earlier , it came when I upgraded the Telerik control for IE 11.

I can commented out the line , but my application is in the production ,so I cant make the such changes.

Is there any way ,to get the same result as it was earlier without commented out the line, with upgraded telerik control on IE 11

 

0
Ivan Danchev
Telerik team
answered on 24 Aug 2015, 03:28 PM
Hello,

Another way to enable Item selection and context menu showing on right click is to set RadListBox' AutoPostBack property to "false".

Which version were you using before upgrading to 2015, 2, 623, 40? We would like to check how its behavior in this scenario differs from the one of the version you are currently using.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Afroz khan
Top achievements
Rank 1
answered on 24 Aug 2015, 04:03 PM

Hello Ivan,

Thanks for your response,earlier I was using Telerik 2013.2.717.40, also I cannot set the AutoPostBack property to false because on the selection of record data gets populate.

 

Thanks

Afroz Khan

 

 

0
Ivan Danchev
Telerik team
answered on 26 Aug 2015, 02:01 PM
Hello,

Thank you for specifying the old version you were using.

The tests showed that the behavior of the RadListBox was different in 2013.2.717.40, however since 2014 Q1 the selection of an item does cause a postback just like in the current version of the controls. This is the expected behavior and it is explained in the SelectedIndexChanged article.

I am afraid there is no way to avoid the postback with the AutoPostBack property set to "true", unless you cancel the SelectedIndexChanging event, but doing so will prevent the item selection.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Afroz khan
Top achievements
Rank 1
answered on 26 Aug 2015, 02:30 PM
Thanks Ivan, I will go with your earlier answer.
0
Afroz khan
Top achievements
Rank 1
answered on 11 Sep 2015, 05:23 PM

Hello Ivan,

Could you please help to get value from Listbox using ContextMenu if I do commented out below line?

e.get_item().select();

Because if I  remove the above line then I will not be able to get the value

 

0
Ivan Danchev
Telerik team
answered on 15 Sep 2015, 02:47 PM
Hello,

Are you trying to get the value from the ListBox item you right click on? This item is accessible in the showContextMenuOnDocumentType handler through the event arguments parameter's get_item() method so you can get its value like this: e.get_item().get_value().

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Afroz khan
Top achievements
Rank 1
answered on 15 Sep 2015, 04:06 PM

Thanks Ivan, I am able to get the Id on context menu ,but still I am really surprise, how  latest version of telerik control changing their functional behavior on running application?

 

0
Accepted
Ivan Danchev
Telerik team
answered on 16 Sep 2015, 03:32 PM
Hello,

This change was introduced in order to make the controls behavior consistent. The behavior of the ListBox control previously to the change that occurred in 2014 Q1 was not correct, so this change can even be considered as a fix, because it leads to expected behavior when the AutoPostBack property is set to "true".

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Afroz khan
Top achievements
Rank 1
answered on 16 Sep 2015, 03:43 PM
Thanks Ivan :)
0
Ivan Danchev
Telerik team
answered on 18 Sep 2015, 01:43 PM
Hello,

You are welcome. Please let us know in case you encounter any issues with the ListBox or another of our controls.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Documentation and Tutorials
Asked by
Afroz khan
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Afroz khan
Top achievements
Rank 1
Share this question
or