- Home
- Forum
- ASP.NET Web Forms
- DataTextField don't work fine if it isn't string
DataTextField don't work fine if it isn't string
I've some DropDownList, similar at this declaracion
<ej:DropDownList ID="ddlTipoOS" runat="server" SelectMethod="GetTiposOS" DataTextField="Codigo" DataValueField="ID" ShowCheckbox="true"></ej:DropDownList>
If DataTextField is a string, it works fine, but if it is an integer, it has an irregular behaviour.
For example, when I check items from a dropdownlist wehre DataTextField is a string, its name is automatically set in dropDownList's text box, but when if the value is an integer not
We are unable to reproduce the issue “When pass DataTextField is an integer value, can’t able set it to the dropdown list box”. We are able to set the selected value in dropdown list while passing the DataTextField as integer value. We have prepared the sample based on your requirement. Please refer to the following sample:
Sample: Sample
Please check with the above sample. If you still face the problem, please revert us by modifying the sample based on your application along with replication procedure. Also let us know if there is any other error occurred in your console window while check the value in dropdownlist popup. Share the screen shot error information. This would be helpful for us to serve you.
Regards,
Kasithangam
I've modified your project and always works fine, I can't reproduce the behaviour of my project.
So, I've copy my config project into a new project for reproduce the error and with my configuration works wrong.
I attach my demo project
Attachment: Web_ControlOperaciones_fdda6eea.zip
On analyzing your sample, we found that you have referred our scripts and CSS references manually and added key settings in web.config file. Also, a script error ““JQuery is not defined”” was thrown in the console window while rendering our controls. To overcome this, remove custom scripts and CSS references and refer only the JQuery script file in Site. Master page.
While enabling LoadEJResourcesFromAssembly and EJResources app key settings in web.config file as shown below code, it will include the necessary script and CSS files as embedded resource from the EJ.Web assembly itself.
<code>
[Web.Config]
<appSettings>
<add key="LoadEJResourcesFromAssembly" value="true" />
<add key="EJResources" value="jsrender:true;jqueryeasing:true;globalize:true;themes:true;" />
</appSettings>
</code>
If you are going to refer scripts and CSS externally, refer the necessary scripts and CSS files in Site.Master page and set false to the “LoadEJResourcesFromAssembly” key which is in the web.config file, it will skip the scripts and CSS files reference from assembly.
<code>
<appSettings>
<add key="LoadEJResourcesFromAssembly" value="false" />
</appSettings>
</code>
We have modified your sample based on this for your reference,
Sample: Sample
Now, you can set the value to the dropdownlist when the DataTextField is passed as an integer value.
Regards,
Kasithangam
Thank you very much!
Hi Manolo,
Thanks for your update.
Please let us know you have any other queries.
Regards,
Saranya.S
- 5 Replies
- 3 Participants
-
MA Manolo
- Sep 28, 2015 03:50 PM UTC
- Oct 2, 2015 04:24 AM UTC