Autocomplete with parameter

6 posts, 0 answers
  1. İsyazilim
    İsyazilim avatar
    8 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    Hi, 
        i have a radcombobox for autocomplete.

     

        I use web service for populate combobox.
        I want to send variables to web service from any other item's value on form (textbox,dropdown etc.)
        Ajaxautocomplete extender, there is UseContextKey feature.

        For radcombobox is there any feature?

        Regards.

     

  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 05 Aug 2010 Link to this post

    Hello Kurkcu,

    Yes, you can use the Context object to send additional data to the web service as described in this demo (see the code in the Products.cs file).

    Kind regards,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. İsyazilim
    İsyazilim avatar
    8 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    Hi,
         I can send additional data to the web service. But i want to send additional data from other items.
        <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="250px" Height="150px">
                    <WebServiceSettings Method="GetCompanyNames" Path="Products.asmx" />
      </telerik:RadComboBox>
        <asp:textbox id="txtAdditionalDataHolder" runat=server/>

        Context is radcombobox content, but i want to add data from textbox.

        Thanks.

  4. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 05 Aug 2010 Link to this post

    Hi Kurkcu,

    You can try collecting data from the other form fields in this way:
    var additionalDataHolder = $get("txtAdditionalDataHolder").value;
    Context["AdditionalDataHolder"] = additionalDataHolder;

    The approach is straightforward: get the form field object and put its value in the Context object with an appropriate key. Later you can get this data from the Context object in the Web Service.

    I hope this helps.

    Sincerely yours,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. İsyazilim
    İsyazilim avatar
    8 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    Hi,
    Where should i use this code? (after which event)
    or can you send me sample code. (Combo box,textbox,javascript)

    Thanks.
  6. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 05 Aug 2010 Link to this post

    Hello Kurkcu,

    The most convenient place to do this is in the client-side ItemsRequesting event handler as described in this help article.

    All the best,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top