RadListBox with Ajax doesn't update on buttonclick

2 posts, 0 answers
  1. sulejman Vezi
    sulejman Vezi avatar
    3 posts
    Member since:
    Nov 2009

    Posted 16 Jul 2013 Link to this post

    Hey Guys.
    I'm having a silly problem with updating the radlistbox on buttonclick.

    can you give me a hint.

    Thnx in advance

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="prova.aspx.cs" Inherits="Pages_prova" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="scriptMgr1">
                        <td align="left">
                            <telerik:RadListBox runat="server" ID="RL_PagesSource" Height="180px" Width="200px" ></telerik:RadListBox>
                        <td valign="top" align="center">
                        <br />
                            <telerik:RadButton ID="RB_PLeft" runat="server" Text=" > " Width="40px"
                                onclick="RB_PLeft_Click" SplitButtonCssClass=""
                                SplitButtonPosition="Right" ></telerik:RadButton><br /><br />
                            <telerik:RadButton ID="RB_PRight" runat="server" Text=" < " Width="40px"
                                SplitButtonCssClass="" SplitButtonPosition="Right" ></telerik:RadButton><br /><br />
                            <telerik:RadButton ID="RB_PLAll" runat="server" Text=" >> " Width="40" ></telerik:RadButton><br /><br />
                            <telerik:RadButton ID="RB_PRAll" runat="server" Text=" << " Width="40" ></telerik:RadButton><br /><br />
                        <td style="padding-left:30px;" align="left">
                            <telerik:RadListBox runat="server" ID="RL_PageDestination" Height="180" Width="200"
                    AutoPostBack="True" onselectedindexchanged="RL_PageDestination_SelectedIndexChanged"></telerik:RadListBox>
        <telerik:RadAjaxManager runat="server">
                <telerik:AjaxSetting AjaxControlID="RB_PLeft">
                        <telerik:AjaxUpdatedControl ControlID="RL_PagesSource" />
                        <telerik:AjaxUpdatedControl ControlID="RL_PageDestination" />

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
    public partial class Pages_prova : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            if (!Page.IsPostBack)
                RL_PagesSource.Items.Add(new RadListBoxItem("aaaa", "asdf"));
                RL_PagesSource.Items.Add(new RadListBoxItem("aasdf", "asdf"));
                RL_PageDestination.Items.Add(new RadListBoxItem("aasasdfadf", "asdf"));
        protected void RB_PLeft_Click(object sender, EventArgs e)
            if (RL_PagesSource.Items.Count == 0 || RL_PagesSource.SelectedItem == null)
                RadListBoxItem it = new RadListBoxItem();
                it = RL_PagesSource.SelectedItem;
                RL_PageDestination.Items.Add(new RadListBoxItem(it.Text, it.Value));
                // RL_PagesSource.SelectedItem.Remove();
                // RL_PagesSource.DataBind();
        protected void RL_PageDestination_SelectedIndexChanged(object sender, EventArgs e)
  2. Bozhidar
    Bozhidar avatar
    1095 posts

    Posted 19 Jul 2013 Link to this post


    Could you elaborate a bit on the exact issue - what is the desired behavior, and how does it differ from the current behavior. Also, could you look at the following demo which demonstrates the Built-in transfer functionality in RadListBox:


    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top