RadListBox Issue with IE 11

13 posts, 1 answers
  1. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 18 Aug 2015 Link to this post

    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;
    }

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 21 Aug 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 21 Aug 2015 in reply to Ivan Danchev Link to this post

    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

     

  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 24 Aug 2015 Link to this post

    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
  6. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 24 Aug 2015 in reply to Ivan Danchev Link to this post

    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

     

     

  7. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 26 Aug 2015 Link to this post

    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
  8. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 26 Aug 2015 in reply to Ivan Danchev Link to this post

    Thanks Ivan, I will go with your earlier answer.
  9. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 11 Sep 2015 Link to this post

    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

     

  10. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 15 Sep 2015 Link to this post

    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
  11. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 15 Sep 2015 in reply to Ivan Danchev Link to this post

    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?

     

  12. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 16 Sep 2015 Link to this post

    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
  13. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 16 Sep 2015 in reply to Ivan Danchev Link to this post

    Thanks Ivan :)
  14. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 18 Sep 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017