Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
WebDropDown Custom template with INT Concatenation
posted

I'm trying to implement a webdropdown with three fields concatenated in the sqldatasource. They are id, firstName and last name. I need for autocompletion to be enabled. The problem is that autocompletion doesn't work when I concatenate and integer. I'm concatenating the integer through cast( id varchar). 

My code works only when I concatenate nvarchar fields such as firstName and lastName, but as soon as I add an integer, the autocompletion stops working.

Is there some type of work around for this?

Here is my code:

<asp:ScriptManager ID="ScriptManager1" runat="server">

    </asp:ScriptManager>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 

                            ConnectionString="<%$ ConnectionStrings:myDB %>" SelectCommand="select donorID, first + ' ' + last as FullName

from Donors"></asp:SqlDataSource>

    <ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" 

        TextField="FullName" ValueField="donorID" DataSourceID="SqlDataSource1">

<DropDownItemBinding TextField="FullName" ValueField="donorID" />

    <ItemTemplate>

    <span style="display:none;"><%#DataBinder.Eval(Container.DataItem, "donorID")%> </span>

                                <%#DataBinder.Eval(Container.DataItem, "FullName")%>

    </ItemTemplate>

    </ig:WebDropDown>

Parents
No Data
Reply Children
No Data