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

RadListbox is not working on server but working fine in local machine

1 Answer 74 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 08 May 2012, 01:30 PM
Hi,
I am using 2 Radlistbox controls in my application for trnasferring items.
the item is transferring well when i press inbuilt transfer button but same it not working on server side after publishing my application in IIS.
i wrote below code:
<telerik:RadListBox runat="server" ID="RadListBoxSource" OnItemDataBound="RadListBoxSource_ItemDataBound"
OnTransferring="RadListBoxSource_Transferring" AllowTransferOnDoubleClick="true" AutoPostBack="true"
AllowTransfer="true" SelectionMode="Multiple" TransferToID="RadListBoxDestination"
AutoPostBackOnTransfer="true" OnSelectedIndexChanged="RadListBoxSource_SelectedIndexChanged">
</telerik:RadListBox>

<telerik:RadListBox runat="server" ID="RadListBoxDestination" AllowTransferOnDoubleClick="true"
EnableDragAndDrop="false" OnSelectedIndexChanged="RadListBoxDestination_SelectedIndexChanged"
SelectionMode="Multiple" OnItemDataBound="RadListBoxDestination_ItemDataBound" AutoPostBack="true"
AutoPostBackOnTransfer="true" />

in c# code behind:

protected void RadListBoxSource_Transferring(object sender, RadListBoxTransferringEventArgs e)
        {            
                if (e.SourceListBox.ID == "RadListBoxSource")
                {
                    if (e.Items.Count == e.SourceListBox.Items.Count)
                    {
                        RadListBoxSource.ClearSelection();
                    }
                    if (RadListBoxSource.SelectedIndex == -1)
                    {
                        if (e.SourceListBox.ButtonSettings.ShowTransferAll == true)
                        {
                            for (int i = 0; i < RadListBoxSource.Items.Count; i++)
                            {
                              if (RadListBoxSource.Items[i].Text == RadListBoxSource.Item[i].Value)
                                    RadListBoxSource.Items[i].Selected = false;
                                else
                                    RadListBoxSource.Items[i].Selected = true;
                            }
                            foreach (RadListBoxItem item in RadListBoxSource.SelectedItems)
                            {
                                AddToDestination(item.Text, item.Value);
                                BindListBoxes();
                            }
                            e.Cancel = true;
                        }                       
                    }
                    else
                    {
                        LeftLstboxSelection();
                        e.Cancel = true;
                    }
                }
                if (e.SourceListBox.ID == "RadListBoxDestination")
                {
                    if (e.Items.Count == e.SourceListBox.Items.Count)
                    {
                        RadListBoxDestination.ClearSelection();
                    }
                    if (RadListBoxDestination.SelectedIndex == -1)
                    {

                        if (e.SourceListBox.ButtonSettings.ShowTransferAll == true)
                        {
                            for (int i = 0; i < RadListBoxDestination.Items.Count; i++)
                            {
                   if (RadListBoxDestination.Items[i].Text == RadListBoxDestination.Items[i].Value)
                                    RadListBoxDestination.Items[i].Selected = false;
                                else
                                    RadListBoxDestination.Items[i].Selected = true;
                            }
                            foreach (RadListBoxItem item in RadListBoxDestination.SelectedItems)
                            {
                                AddToSource(item.Text, item.Value);
                            }
                            BindListBoxes();
                            e.Cancel = true;

                        }
                    }
                    else
                    {
                        RightLstboxSelection();
                        e.Cancel = true;
                    }
                }
                if (RadListBoxDestination.Items.Count == 0)
                {
                                    
                    btnExportTemplate.CssClass = "my_custom_button_gray_l";
                    btnExportTemplate.Enabled = false;
                }
                else
                {                                   
                    btnExportTemplate.CssClass = "my_custom_button_l";
                    btnExportTemplate.Enabled = true;
                }          
           
        }

after publishing on server item is not tranferring when  double click or selecting item.

Please support.waiting for quick response from Telerik Team


Thanks & Regards,
Santhosh Naik

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 11 May 2012, 07:20 AM
Hello Santhosh,

Could you please check whether there are any JavaScript errors on the page once the site is deployed? Here and here are two help article giving instruction on how to troubleshoot such problems. Please review them and try to apply the provided solutions.

Regards,
Dimitar Terziev
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.
Tags
ListBox
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or