RadListBox question

3 posts, 1 answers
  1. Bob
    Bob avatar
    11 posts
    Member since:
    Jun 2017

    Posted 05 Jul Link to this post

    Hi,

    I have 2 listbox controls on my web page.  I have one on the left that is populated from a SQL table in my database.  I can then select one or more row from the left listbox and then click the right-arrow button to move the row to the right-side listbox.  But I do not want to allow the right-side listbox items to be moved to the left-side listbox.  So I want to know if there is a way to not display the left arrow button when items are selected on the right-side listbox.  

    Thanks in advance!

    Here is the code for each listbox:

    <telerik:RadListBox ID="lstAvailable"
        runat="server"
    Width="270px"
    Height="200px"
    SelectionMode="Multiple"
    AllowTransfer="true"
    TransferToID="lstMapped"
    ButtonSettings-AreaWidth="40px"
    AutoPostBackOnTransfer="true"
    DataTextField="ReportName"
    DataValueField="ReportID"
    OnTransferring="lstAvailable_Transferring">
    </telerik:RadListBox>
                            <telerik:RadListBox ID="lstMapped"
    runat="server"
    Width="270px"
    Height="200px"
    SelectionMode="Multiple"
    AllowDelete="true"
    AllowReorder="true"
    AllowTranfer="false"
    ButtonSettings-AreaWidth="40px"
    AutoPostBackOnTransfer="false"
    DataTextField="ReportName"
    DataValueField="ReportID"
    OnDeleting="lstMapped_Deleting">
                            </telerik:RadListBox>

  2. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    259 posts

    Posted 10 Jul Link to this post

    Hello Bob,

    You can easily hide the Left buttons using the CSS provided in the Hide the Transfer to Left button article.

    div.RadListBox .rlbTransferTo,
    div.RadListBox .rlbTransferToDisabled,
    div.RadListBox .rlbTransferAllToDisabled,
    div.RadListBox .rlbTransferAllTo
    {
        display: none;
    }

    Also, I would suggest you review the Transfer only from one direction article that suggests a programmatic solution for disabling the transfer by canceling the OnClientTransferring event.

    Regards,
    Peter Milchev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Bob
    Bob avatar
    11 posts
    Member since:
    Jun 2017

    Posted 10 Jul in reply to Peter Milchev Link to this post

    That worked!

     

    Thanks Peter.

Back to Top