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

RadListBox question

2 Answers 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 05 Jul 2017, 11:43 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Peter Milchev
Telerik team
answered on 10 Jul 2017, 09:18 AM
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.
0
Bob
Top achievements
Rank 1
answered on 10 Jul 2017, 01:47 PM

That worked!

 

Thanks Peter.

Tags
Ajax
Asked by
Bob
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Bob
Top achievements
Rank 1
Share this question
or