Auto Complete textbox bind text and value

6 posts, 0 answers
  1. Suraj
    Suraj avatar
    4 posts
    Member since:
    Aug 2013

    Posted 13 Oct 2013 Link to this post

    Hi 
        i  have an auto complete text box i am able to  bind the the data to the text box  i  am able to  retrieve the value and store it in the database
    No i want know how do i bind the the saved value  in the database to the to auto complete text box  again i tried somewhat like this 
             
    AutoCompleteBoxEntry childNode = new AutoCompleteBoxEntry();
                  childNode.Text = lblTeamLeaderName.Text;
                childNode.Value = lblTASKTEAM_ID.Text;
                txtusers.Entries.Add(childNode);

    and
    txtusers.Entries[0].Value = lblTASKTEAM_ID.Text;
                     txtusers.Entries[0].Text = lblTeamLeaderName.Text;


    but still value which is saved  is not being shown in the textbox i want to bind the text and value some what like  dropdownlist box  can any one  tell where i am going wrong





  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Oct 2013 Link to this post

    Hi Suraj,

    Can you explain a bit more about your scenario like what type of binding are you using?

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Suraj
    Suraj avatar
    4 posts
    Member since:
    Aug 2013

    Posted 17 Oct 2013 Link to this post

     i a have one value in the databse as 2  now i want to   bind  this 2 to auto complete text box this two has master value say the city name
    some what similar to  dropdownlist in asp.net
     how we bind the  like how we dolike this
    ddl.clearselection();
    ddl.items.findbyvalue("2").selected =true;
  5. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 21 Oct 2013 Link to this post

    Hello Suraj,

    RadAutoCompleteBox doesn't use the regular binding mechanism that the DropDownList does. It's actually never bound in the sense that you have access to its items on the server. Only when you type something in the textbox does it request and render the matched items, after which they are again lost. So you won't be able to do something like autoCompleteBox.Items..., because the items are not accessible. 

    Instead you have to use the approach you pointed out in your first post - creating a new Entry manually and inserting it into the RadAutoCompleteBox. I've also attached a simple sample page demonstrating this approach.
     

    Regards,
    Bozhidar
    Telerik
    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 the blog feed now.
  6. Suraj
    Suraj avatar
    4 posts
    Member since:
    Aug 2013

    Posted 21 Oct 2013 Link to this post

    ok :)
  7. Dell
    Dell avatar
    1 posts
    Member since:
    Nov 2014

    Posted 24 Apr 2015 Link to this post

    Try this one....simple and easy

    http://net-informations.com/q/faq/autocomplete.html

    Dell

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017