Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

The control DataSource(or DataSourceID) is not set.

$
0
0

Hi,

 I try to Bind an RadAutoCompleteBox with a Dictionnary, but I have this error message when the page i​s loaded and I tap a letter into the RadAutoCompleteBox => "The control DataSource(or DataSourceID) is not set."

 

I try the following code :

ASCX :

<telerik:RadAutoCompleteBoxrunat="server"ID="RadAutoCompleteBox1"InputType="Text"Width="200"DropDownWidth="150px"></telerik:RadAutoCompleteBox>

 

ASCX.CS

01.protectedvoidPage_Load(objectsender, EventArgs e)
02.{
03. if(!Page.IsPostBack)
04.  {
05.   Dictionary<int, string> dict = newDictionary<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


Viewing all articles
Browse latest Browse all 94857

Trending Articles