Hello,
I am currently trying to transfer RadListBox items from one control to another using programming code (Csharp).
Here is my setup:
(Missing info in SqlDataSource was intentional).
Every time I run this, I get "Object Reference not set to an instance of an object." on the RadListBoxItem founditem line in the CSharp code.
What am I doing wrong?
I am currently trying to transfer RadListBox items from one control to another using programming code (Csharp).
Here is my setup:
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadListBox
ID
=
"RadListBox1"
OnLoad
=
"RadListBox1_OnLoad"
AllowTransfer
=
"true"
Height
=
"400px"
Width
=
"300px"
DataSourceID
=
"SqlDataSource1"
DataValueField
=
"AmRepID"
DataTextField
=
"RepInfo"
AllowTransferOnDoubleClick
=
"true"
SelectionMode
=
"Multiple"
TransferMode
=
"Move"
TransferToID
=
"RepBoxSelected"
runat
=
"server"
>
</
telerik:RadListBox
>
<
telerik:RadListBox
ID
=
"RepBoxSelected"
Height
=
"400px"
Width
=
"300px"
TransferToID
=
"RadListBox1"
runat
=
"server"
>
</
telerik:RadListBox
>
<
br
/>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionString %>"
SelectCommand="SELECT Statement Here"></
asp:SqlDataSource
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Text.RegularExpressions;
using
Telerik.Web.UI;
public
partial
class
reports_MassMail : System.Web.UI.Page
{
protected
void
RadListBox1_OnLoad(
object
sender, EventArgs e)
{
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadListBoxItem founditem = RadListBox1.FindItemByText(
"CAMPUS - <Rep Name>"
);
RadListBox1.Transfer(founditem, RadListBox1, RepBoxSelected);
}
}
(Missing info in SqlDataSource was intentional).
Every time I run this, I get "Object Reference not set to an instance of an object." on the RadListBoxItem founditem line in the CSharp code.
What am I doing wrong?