This is a migrated thread and some comments may be shown as answers.

remoting datasource

3 Answers 40 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Kevin Cauchi
Top achievements
Rank 1
Kevin Cauchi asked on 24 Sep 2012, 10:11 AM
Hi there, 

I am using the RadAutoCompleteBox  control and I have a question. 

I see you can bind it to a sql provider or even a webservice. In my case I do not want to put in the sql on the page. I have a remoting object and i wish to use its method. 

How would be the best way to implement in such an environment.

Thanks

K

3 Answers, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 27 Sep 2012, 01:37 PM
What data does your remoting object return?
0
Kevin Cauchi
Top achievements
Rank 1
answered on 27 Sep 2012, 01:40 PM
Dictionary<int, string>  .... int is for the id and string is for the username
0
Accepted
Kalina
Telerik team
answered on 02 Oct 2012, 12:21 PM
Hello Kevin Cauchi,

You can populate the RadAutoCompleteBox via Dictionary in this way:
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server">
</telerik:RadAutoCompleteBox>
protected void Page_Load(object sender, EventArgs e)
{
        Dictionary<int, string> dict = new Dictionary<int, string>();
        // I have added some dummy dictionary entries, you will obtain real data here ...
        dict.Add(1, "Ann");
        dict.Add(2, "John");
        dict.Add(3, "Mary");
        RadAutoCompleteBox1.DataSource = dict;
        RadAutoCompleteBox1.DataTextField = "Value";
        RadAutoCompleteBox1.DataValueField = "Key";

 
}


Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AutoCompleteBox
Asked by
Kevin Cauchi
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Kevin Cauchi
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or