remoting datasource

4 posts, 1 answers
  1. Kevin Cauchi
    Kevin Cauchi avatar
    38 posts
    Member since:
    Dec 2009

    Posted 24 Sep 2012 Link to this post

    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
  2. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 27 Sep 2012 Link to this post

    What data does your remoting object return?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kevin Cauchi
    Kevin Cauchi avatar
    38 posts
    Member since:
    Dec 2009

    Posted 27 Sep 2012 Link to this post

    Dictionary<int, string>  .... int is for the id and string is for the username
  5. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 02 Oct 2012 Link to this post

    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.
Back to Top