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>
Hello Boruch,
I know a couple of months have passed since you asked this question but in case you still need asssitnace I will provide an answer. Please take a look at the attached sample created via NetAdvantage 11.2.20112.1019 and tested under IE9. The issue (Conversion failed when converting the nvarchar value '******' to data type int. ) is reproducible, but if you examine the stack trace of the exception you will noticed that it is not caused by our controls but from the select command. Please take a look at the following threads: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98843
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/f522932d-2777-4f42-82f8-3d407fc68dbd/