This is a migrated thread and some comments may be shown as answers.

EnableClientFiltering with dynamic loaded AutoCompleteBox

1 Answer 51 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Massimiliano
Top achievements
Rank 1
Massimiliano asked on 12 Feb 2014, 04:49 PM
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">
</asp:SqlDataSource>

Any hint on how to overcome the issue? 

1 Answer, 1 is accepted

Sort by
0
Massimiliano
Top achievements
Rank 1
answered on 12 Feb 2014, 05:39 PM
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)
ProvinciaId.DataBind()

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.

Tags
AutoCompleteBox
Asked by
Massimiliano
Top achievements
Rank 1
Answers by
Massimiliano
Top achievements
Rank 1
Share this question
or