Set selected value without binding

3 posts, 0 answers
  1. Mickael
    Mickael avatar
    24 posts
    Member since:
    Oct 2014

    Posted 11 Oct 2014 Link to this post

    Hi,

    I have a RadAutoCompleteBox that I add dynamically at run time for editing values.
    I can set all settings that I need and add it to the page without problems.

    I just can't find out how to set it's text value because the 'text' property is read only.
    I want to search the items only when the user modifies the current value.

    This is my code so far:

    _autoCompleteBox = new RadAutoCompleteBox();
    _autoCompleteBox.ID = String.Format("Extra_RdtCmpltBx_{0}_{1}", Data.Name, ID);
    _autoCompleteBox.Filter = RadAutoCompleteFilter.StartsWith;
    _autoCompleteBox.DropDownPosition = RadAutoCompleteDropDownPosition.Automatic;
    _autoCompleteBox.AllowCustomEntry = true;
    _autoCompleteBox.InputType = RadAutoCompleteInputType.Text;
    _autoCompleteBox.WebServiceSettings.Method = "GetResults";
    _autoCompleteBox.WebServiceSettings.Path = "Popup_EditData.aspx";
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 14 Oct 2014 Link to this post

    Hello Michael,

    In order to achieve the desired functionality, you need to add a new entry to the EntriesCollection of the programmatically created RadAutoCompleteBox. Please consider the following implementation :

    _autoCompleteBox = new RadAutoCompleteBox();
    _autoCompleteBox.ID = String.Format("Extra_RdtCmpltBx_{0}_{1}", Data.Name, ID);
    _autoCompleteBox.Filter = RadAutoCompleteFilter.StartsWith;
    _autoCompleteBox.DropDownPosition = RadAutoCompleteDropDownPosition.Automatic;
    _autoCompleteBox.AllowCustomEntry = true;
    _autoCompleteBox.InputType = RadAutoCompleteInputType.Text;
    _autoComplete.Entries.Add(new AutoCompleteBoxEntry("Custom Entry"));
    _autoCompleteBox.WebServiceSettings.Method = "GetResults";
    _autoCompleteBox.WebServiceSettings.Path = "Popup_EditData.aspx";



    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mickael
    Mickael avatar
    24 posts
    Member since:
    Oct 2014

    Posted 14 Oct 2014 in reply to Nencho Link to this post

    Works like a charm.
    Thanks a lot :)
Back to Top