RadPanelBar item double click

10 posts, 0 answers
  1. Jean-Francois
    Jean-Francois avatar
    2 posts
    Member since:
    Nov 2007

    Posted 16 Jun 2008 Link to this post

    Hi,
    Is there a way to trap double click event on server-side event? I need to trap single click and double click to make a different action depending on what event is called.

    Thank you!
  2. Poul Henningsen
    Poul Henningsen avatar
    194 posts
    Member since:
    May 2006

    Posted 16 Jun 2008 Link to this post

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saif
    Saif avatar
    5 posts
    Member since:
    Feb 2005

    Posted 10 Aug 2011 Link to this post

    Sir,

    I also need the double click event. But I need to know how i can make a double click event option in RadPanelBar Item, RadPanelBar item click event is working fine, but i need to get the double click event. Or how can i make a custom double click event using the clickevent option.
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 15 Aug 2011 Link to this post

    Hello Danilo,

    Here is one possible workaround with jQuery:
    <script type="text/javascript">    
          function OnClientLoad(sender) {
              var $ = $telerik.$;
              for (var i = 0; i < sender.get_allItems().length; i++) {
                  var item = sender.get_allItems()[i];
                  $(".rpText", item.get_element()).dblclick(function (e) {
                      alert($(this).text());
                  });
                  
              }
          }
      </script>
      <telerik:RadPanelBar ID="RadPanelBar1" runat="server"  OnClientLoad="OnClientLoad">


    Kind regards,
    Peter
    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.

  6. Jayaprakash
    Jayaprakash avatar
    4 posts
    Member since:
    Jan 2012

    Posted 26 Mar 2012 Link to this post


    I also need the double click event. i want to handle it in server side. how to call server side code.
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 28 Mar 2012 Link to this post

    Hello,

    You can use the approach from this help topic -
    Manually Add an AJAX Request to a Client-Side Event of an HTML Element

    Greetings,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Jayaprakash
    Jayaprakash avatar
    4 posts
    Member since:
    Jan 2012

    Posted 29 Mar 2012 Link to this post

    Peter,

    function OnClientLoad(sender) {
                    var $ = $telerik.$;
                    for (var i = 0; i < sender.get_allItems().length; i++) {
                        var item = sender.get_allItems()[i];
                        $(".rpText", item.get_element()).dblclick(function (e) {
                            var ajaxManager = $find("<%= ajaxManager.ClientID %>");
                            var value = sender.get_selectedItem().get_text() + '~' + sender.get_selectedItem().get_value();
                            ajaxManager.ajaxRequest(value);
                        });
                    }
                }

    double click function(highlighted in bold letters) get fired twice. i don't know why? which causes two postbacks one with Page.IsPostBack = false and one with true. what could be the reason? please help.

    Thanks
    Jayaprakash Krishnan
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 03 Apr 2012 Link to this post

    Hello Jayaprakash,

    I am not sure what could be causing this. Does this prevent you from achieving the functionality you need?


    Kind regards, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  10. Jayaprakash
    Jayaprakash avatar
    4 posts
    Member since:
    Jan 2012

    Posted 03 Apr 2012 Link to this post

    Peter,
    Thanks for your reply.

    Yes , the code block getting executed two times and causing two postbacks. In server side Page_Load event am loading data if post back is false, because of this issue unnecessarily data getting loaded. below is the  client side code

    function OnClientLoad(sender) {
                    var $ = $telerik.$;
                    for (var i = 0; i < sender.get_allItems().length; i++) {
                        var item = sender.get_allItems()[i];
                        $(".rpText", item.get_element()).dblclick(function (e) {
                             
                                var ajaxManager = $find("<%= ajaxManager.ClientID %>");
                                var value = sender.get_selectedItem().get_text() + '~' + sender.get_selectedItem().get_value();
                                ajaxManager.ajaxRequest(value);
                             
                             
                        });
                    }
                }
     
    <telerik:RadPanelBar ID="radPanelTransfer" runat="server" Style="float: left" Skin="Windows7"
                                            OnClientItemClicked="OnClientItemClicked" Width="100%" OnClientLoad="OnClientLoad" />

     Is it because of OnClientItemClicked event?

     

    function OnClientItemClicked(sender, args) {
     
                    switch (sender._element.id) {
                        case 'radPanelGeneral':
                            DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
                            break;
                        case 'radPanelProcessing':
                            DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
                            break;
                        case 'radPanelTransfer':
                            DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
                            break;
                        case 'radPanelOther':
                            DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
                            break;
                        case 'radPanelFinancial':
                            DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
                            DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
                            break;
                        default:
                            break;
                    }
                }
     
                function DeselectOtherPanelItems(panel) {
                    var selectedItem = panel.get_selectedItem();
                    if (selectedItem != null)
                        selectedItem.set_selected(false);
                }

    What could be the reason?
    Awaiting for your reply.

    Thanks
    Jayaprakash

     

     

     

  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 05 Apr 2012 Link to this post

    Hello Jayaprakash,

    What are you RadAjax settings? If you have a setting that says that RadPanelBar should update itself, can you remove it and test the case again?

    Regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017