AllowTransferOnDoubleClick=true does not generate postback

5 posts, 2 answers
  1. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 13 Jun 2012 Link to this post

    this is my aspx code

     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%" LoadingPanelID="LoadCombo" >
                                <div class="leftContainerIn">
                                    <telerik:RadListBox ID="rlbAvailable" runat="server" Width="100%" AllowTransfer="true"
                                       TransferToID="rlbChosen" SelectionMode="Multiple"
                                      AllowTransferOnDoubleClick="true"
                                        


                                        Height="100%" EnableDragAndDrop="true" DataValueField="FieldId" DataTextField="tempHeader"
                                        Sort="Ascending" OnClientTransferring="rlbAvailable_OnClientTransferring" AutoPostBackOnTransfer="true"
                                        OnTransferred="rlbAvailable_OnTransferred" ButtonSettings-ShowTransferAll="true">
                                    </telerik:RadListBox>
                                </div>
                                <div class="rightContainerIn">
                                    <telerik:RadListBox ID="rlbChosen" runat="server" Sort="Ascending" Width="100%" Height="100%"
                                        AutoPostBack="true" OnSelectedIndexChanged="rlbChosen_SelectedIndexChange" SelectionMode="Multiple"
                                        EnableDragAndDrop="true"  AllowTransferOnDoubleClick="false"
                                        AllowReorder="true" DataTextField="tempHeader" DataValueField="FieldId" TransferToID="rlbAvailable">
                                    </telerik:RadListBox>
                                </div>
                            </telerik:RadAjaxPanel>

    this is my cs code

     protected void rlbAvailable_OnTransferred(object sender, RadListBoxTransferredEventArgs e)
            {
                try
                {


                    List<smDocumentTypeField> avalible = FieldsOrganization;
                    List<smDocumentTypeField> documentTypeFields = DocumentTypeField;


                    if (e.DestinationListBox != sender) // from left to right
                    {
                        foreach (RadListBoxItem ite in e.Items)
                        {
                            int id = Convert.ToInt32(ite.Value);
                            documentTypeFields.Insert(0, GetField(FieldsOrganization, id));
                            avalible.Remove(GetField(FieldsOrganization, id));


                        }


                       
                    }
                    else if (e.DestinationListBox == sender)// from right to left
                    {
                        foreach (RadListBoxItem ite in e.Items)
                        {
                            int id = Convert.ToInt32(ite.Value);


                            avalible.Insert(0, GetField(DocumentTypeField, id));
                            documentTypeFields.Remove(GetField(DocumentTypeField, id));
                        }
                    }


                   FieldsOrganization = avalible;
                    DocumentTypeField = documentTypeFields;
                    rlbChosen.DataBind();
                    rlbAvailable.DataBind();
                }
                catch (Exception ex)
                {
                    Notification.LoadCatchNotification(ex, typeof (DocumentTypeForm).FullName);
                }
            }


    this event does not execute when i did double click on radlistboxitem, Why?

    I need help!!


    regards

  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 18 Jun 2012 Link to this post

    Hello Julieta,

    You have to remove the TransferToID attribute from the second ListBox. This attribute only has to be set on the first ListBox.
     
    All the best,
    Bozhidar
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 18 Jun 2012 Link to this post

    Thanks! Taht's works!!!
  5. Answer
    Craig
    Craig avatar
    1 posts
    Member since:
    Jan 2010

    Posted 05 Sep 2012 Link to this post

    Removing the TransferToID doesn't fix the problem for me as I need the ability to transfer to/from both my ListBox's i.e. lb1 to lb2 and lb2 to lb1

    Why don't you raise the Transferred event on DoubleClick?  Havng to use OnClientTransferred is a real pain as I now need to hack code to get the same functionality of my Transferred event.
  6. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 10 Sep 2012 Link to this post

    Hello Jeff,

    When you have two RadListBoxes on the page and you want to allow the transfer of items between them, you only need to set the TransferToID property of the first ListBox. Please refer to the following demo to see a working example of this:
    http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/transfer/defaultcs.aspx 

    As you can see in the demo, although the property is set only on the first ListBox, you can transfer items in both directions.

    As for the second part of your question, in order for the Transferred server event to be fired, you have to set the AutoPostBackOnTransfer property to true.
     
    Regards,
    Bozhidar
    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