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

Radlist Item Client Side problem wirh list array...

2 Answers 64 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Moksha
Top achievements
Rank 1
Moksha asked on 07 Mar 2011, 10:02 AM
Hi.....

I have 2 radlistbox

using javascript ---On click of Add button i am transftering data from radlistbox 1 to radlistbox 2........

After transfttering item in radllistbox2 radlistitem2's item.set_checked(true) doesn't work..... list items remains as it is as un check....

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Mar 2011, 01:52 PM
Hello Moksha,

I am not quite sure about the method that you tried o transfer the items.Here I am pasting the two approaches that I tried.

Method1:Using the built-in property AllowTransfer="true"
aspx:
<telerik:RadListBox ID="RadListBox1" runat="server"
        TransferToID="RadListBox2" AllowTransfer="true"  CheckBoxes="true" >
        <Items>
            <telerik:RadListBoxItem Text="Argentina" />
            <telerik:RadListBoxItem Text="Australia" />
            <telerik:RadListBoxItem Text="Brazil" Selected="true" />
            <telerik:RadListBoxItem Text="Canada" />
        </Items>
 </telerik:RadListBox>
<telerik:RadListBox ID="RadListBox3" runat="server" CheckBoxes="true">
</telerik:RadListBox>

Method2:Transfer Items on external button click.
<telerik:RadListBox ID="RadListBox1" runat="server" EnableDragAndDrop="true"
        TransferToID="RadListBox3"  CheckBoxes="true" >
        <Items>
            <telerik:RadListBoxItem Text="Argentina" />
            <telerik:RadListBoxItem Text="Australia" />
        </Items>
 </telerik:RadListBox>
<telerik:RadListBox ID="RadListBox3" runat="server" CheckBoxes="true">
</telerik:RadListBox>
<asp:Button ID="Button1" runat="server"  OnClientClick="OnClientClick();" />

JavaScript:
function OnClientClick()
 {
     var listbox = $find("<%= RadListBox1.ClientID %>");
     var item = listbox.get_selectedItem();
     listbox.transferToDestination(item);
 }
Thanks,
Shinu.
0
Moksha
Top achievements
Rank 1
answered on 08 Mar 2011, 01:54 PM
Hi Shinu

Thanks for replay

I have already tried this method. actually my probem is i have created radlistbox using javascript at client side .... it's items do not get reflectet without postback. and i want item get reflect without postback....

if i use listbox.transferToDestination(item) or listbox.get_iteams.getitems.add(item) both give me an index error  during saving data
Tags
ListBox
Asked by
Moksha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Moksha
Top achievements
Rank 1
Share this question
or