Hi,
I try to Bind an RadAutoCompleteBox with a Dictionnary, but I have this error message when the page is loaded and I tap a letter into the RadAutoCompleteBox => "The control DataSource(or DataSourceID) is not set."
I try the following code :
ASCX :
<
telerik:RadAutoCompleteBox
runat
=
"server"
ID
=
"RadAutoCompleteBox1"
InputType
=
"Text"
Width
=
"200"
DropDownWidth
=
"150px"
></
telerik:RadAutoCompleteBox
>
ASCX.CS
01.
protected
void
Page_Load(
object
sender, EventArgs e)
02.
{
03.
if
(!Page.IsPostBack)
04.
{
05.
Dictionary<
int
,
string
> dict =
new
Dictionary<
int
,
string
>();
06.
dict.Add(1,
"Ann"
);
07.
dict.Add(2,
"John"
);
08.
dict.Add(3,
"Mary"
);
09.
RadAutoCompleteBox1.DataSource = dict;
10.
RadAutoCompleteBox1.DataTextField =
"Value"
;
11.
RadAutoCompleteBox1.DataValueField =
"Key"
;
12.
}
13.
}
Thanks for helping me