Hey Guys.
I'm having a silly problem with updating the radlistbox on buttonclick.
can you give me a hint.
Thnx in advance
------.aspx------
-----.aspx.cs----
I'm having a silly problem with updating the radlistbox on buttonclick.
can you give me a hint.
Thnx in advance
------.aspx------
<%@ 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"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager runat="server" ID="scriptMgr1"> </asp:ScriptManager> <table> <tr> <td align="left"> <telerik:RadListBox runat="server" ID="RL_PagesSource" Height="180px" Width="200px" ></telerik:RadListBox> </td> <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> <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> </td> </tr> </table> </div> <telerik:RadAjaxManager runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RB_PLeft"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RL_PagesSource" /> <telerik:AjaxUpdatedControl ControlID="RL_PageDestination" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> </form></body></html>-----.aspx.cs----
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) { } else { RadListBoxItem it = new RadListBoxItem(); it = RL_PagesSource.SelectedItem; RL_PageDestination.Items.Add(new RadListBoxItem(it.Text, it.Value)); RL_PageDestination.DataBind(); // RL_PagesSource.SelectedItem.Remove(); // RL_PagesSource.DataBind(); } } protected void RL_PageDestination_SelectedIndexChanged(object sender, EventArgs e) { }}