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

The control DataSource(or DataSourceID) is not set.

$
0
0
Hi vallin,

You should bind the RadAutoCompleteBox control on Page_Load and the DataBind method must be called after setting the DataSource property:
protected void Page_Load(object sender, EventArgs e)
{
    Dictionary<int, string> dict = new Dictionary<int, string>();
 
    dict.Add(1, "Ann");
 
    dict.Add(2, "John");
 
    dict.Add(3, "Mary");
 
    RadAutoCompleteBox1.DataSource = dict;
 
    RadAutoCompleteBox1.DataTextField = "Value";
 
    RadAutoCompleteBox1.DataValueField = "Key";
 
    RadAutoCompleteBox1.DataBind();
 
}

Attached you may a project I made for testing using the code you sent.

Please check our help articles for more information on DataBindings:
http://docs.telerik.com/devtools/aspnet-ajax/controls/autocompletebox/data-binding/overview

Regards,
Aneliya Petkova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>