EnableClientFiltering with dynamic loaded AutoCompleteBox

2 posts, 0 answers
  1. Massimiliano
    Massimiliano avatar
    185 posts
    Member since:
    Oct 2012

    Posted 12 Feb 2014 Link to this post

    I have an autocomplete box wich is loaded dynamically inside a RadGrid nestedviewtemplate. It seems that in this scenario the "EnableClientFiltering" property set to true won't work and always provide an empty dropdown

            <telerik:RadAutoCompleteBox runat="server" ID="ProvinciaId" AllowCustomText="false" MaxLength="80"
                                        EmptyMessage="Provincia di nascita" CssClass="span3" DataSourceID="SqlDataSource1" DataValueField="ProvinciaId" DataTextField="ProvinciaName" Filter="StartsWith" IsCaseSensitive="false"
                                        DropDownHeight="250" TextSettings-SelectionMode="Single" TokensSettings-AllowTokenEditing="false" AllowCustomEntry="false" InputType="Text" EnableClientFiltering="true" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EvaConnection %>"
                       ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ProvinciaId], [ProvinciaName] FROM [EVA_Province] ORDER BY [ProvinciaName] ASC">

    Any hint on how to overcome the issue? 

  2. Massimiliano
    Massimiliano avatar
    185 posts
    Member since:
    Oct 2012

    Posted 12 Feb 2014 in reply to Massimiliano Link to this post

    Just in case someone has the same issue.
    I moved binding in user control page init event with a fake binding wich will avoid throwing "no datasource" exception. Something like that

    ProvinciaId.DataSource = New List(Of EvaVwProvinceDropDownList)

    Then in my real on-time (so it doesn't occur on each postback) function that I use to initialize the user control, I do the proper binding.
    I could not simply check the "Not Page.IsPostback" on the init event of the user control to do there the proper binding because when you expand the RadGrid row a postback occurs, so there was no way to tell if the grid was just expanded or not.
    Infact from RadGrid I call a function inside my user control only when row is expanded to initialize it.

Back to Top