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

2 posts, 0 answers
  1. Santhosh
    Santhosh avatar
    15 posts
    Member since:
    May 2012

    Posted 08 May 2012 Link to this post

    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
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 11 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top