Hi, i'am new using telerik controls.
I hace an application c#, and i want to transfer Radlistbox items to an other Radlistbox. The first Radlistbox 1 is filled with datasource binding, and the second Radlistbox2 has to be filled with items from Radlistbox1. Ofcourse with Transfermode="copy"
My application can be transfer items to the other Radlistbox2, but only one of the columns, i think. I want to transfer all columns to Radlistbox2. My code is as follow:
AND THE CODE BEHIND IS:
Those radlistboxes within a RadPanelBar.
Please help me.
note.- sorry if i wrote with mistakes, my native language is spanish.
I hace an application c#, and i want to transfer Radlistbox items to an other Radlistbox. The first Radlistbox 1 is filled with datasource binding, and the second Radlistbox2 has to be filled with items from Radlistbox1. Ofcourse with Transfermode="copy"
My application can be transfer items to the other Radlistbox2, but only one of the columns, i think. I want to transfer all columns to Radlistbox2. My code is as follow:
..........
<
style
type
=
"text/css"
>
.list {
float: left;
width: 100px;
}
.idClass {
float: left;
width: 20px;
}
</
style
>
.........
<
telerik:RadListBox
ID
=
"RadListBox1"
runat
=
"server"
Width
=
"400px"
Height
=
"200px"
TransferToID
=
"RadListBox2"
AllowTransfer
=
"true"
SelectionMode
=
"Multiple"
AutoPostBackOnTransfer
=
"true"
AllowReorder
=
"true"
AutoPostBackOnReorder
=
"true"
EnableDragAndDrop
=
"true"
OnDropped
=
"RadListBox_Dropped"
AppendDataBoundItems
=
"False"
DataSourceID
=
"SqlDataSource1"
DataTextField
=
"Nombre"
DataValueField
=
"ID"
OnTransferred
=
"RadListBox1_Transferred"
OnItemDataBound
=
"RadListBox1_ItemDataBound"
TransferMode
=
"Copy"
CausesValidation
=
"false"
>
<
ButtonSettings
ShowTransfer
=
"false"
/>
<
ItemTemplate
>
<
span
style
=
"float:left;"
>
<
img
src='<%# Eval("Foto") %>' width="30px" height="30px" alt="dd"/>
</
span
>
<
span
style
=
"float:left;padding:10px"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text='<%# Eval("ID") %>' CssClass="idClass"></
asp:Label
>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
Text='<%# Eval("Nombre") %>' CssClass="list"></
asp:Label
>
<
asp:Label
ID
=
"Label3"
runat
=
"server"
Text='<%# Eval("Apellidos") %>' CssClass="list"></
asp:Label
>
<
asp:Label
ID
=
"Label4"
runat
=
"server"
Text='<%# Eval("Rol") %>'></
asp:Label
>
</
span
>
</
ItemTemplate
>
</
telerik:RadListBox
>
<
telerik:RadListBox
ID
=
"RadListBox2"
runat
=
"server"
Width
=
"400px"
Height
=
"200px"
AllowTransfer
=
"true"
SelectionMode
=
"Multiple"
AllowReorder
=
"true"
AutoPostBackOnTransfer
=
"true"
TransferMode
=
"Copy"
AutoPostBackOnReorder
=
"true"
TransferToID
=
"RadListBox3"
EnableDragAndDrop
=
"true"
AppendDataBoundItems
=
"false"
OnDropped
=
"RadListBox_Dropped"
>
<
ItemTemplate
>
<
span
style
=
"float:left;"
>
<
img
src='<%# Eval("Foto") %>' width="30px" height="30px" alt="dd"/>
</
span
>
<
span
style
=
"float:left;padding:10px"
>
<
asp:Label
ID
=
"Label5"
runat
=
"server"
Text='<%# Eval("ID") %>' CssClass="idClass"></
asp:Label
>
<
asp:Label
ID
=
"Label6"
runat
=
"server"
Text='<%# Eval("Nombre") %>' CssClass="list"></
asp:Label
>
<
asp:Label
ID
=
"Label7"
runat
=
"server"
Text='<%# Eval("Apellidos") %>' CssClass="list"></
asp:Label
>
<
asp:Label
ID
=
"Label8"
runat
=
"server"
Text='<%# Eval("Rol") %>'></
asp:Label
>
</
span
>
</
ItemTemplate
>
</
telerik:RadListBox
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CNXPostes%>"
ProviderName="System.Data.SqlClient"
SelectCommand="select Foto,ID, Nombre, Apellidos, Rol from empleado">
</
asp:SqlDataSource
>
AND THE CODE BEHIND IS:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Text;
using Telerik.Web.UI;
public partial class Admin_TratandoProbar : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadListBox_Dropped(object sender, RadListBoxDroppedEventArgs e)
{
}
protected void RadListBox1_ItemDataBound(object sender, RadListBoxItemEventArgs e)
{
}
protected void RadListBox1_Transferred(object sender, RadListBoxTransferredEventArgs e)
{
// foreach (RadListBoxItem item in e.Items)
//{
// item.DataBind();
//}
}
}
Those radlistboxes within a RadPanelBar.
Please help me.
note.- sorry if i wrote with mistakes, my native language is spanish.