We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DataTextField don't work fine if it isn't string

Hi,

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



5 Replies

KC Kasithangam C Syncfusion Team September 29, 2015 12:06 PM UTC

Hi Manolo,

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





MA Manolo September 30, 2015 07:41 AM UTC

Hi,

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


KC Kasithangam C Syncfusion Team October 1, 2015 09:19 AM UTC

Hi Manolo,

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 LoadEJResourcesFromAssemblykey 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



MA Manolo October 1, 2015 09:58 AM UTC

Ok!

Thank you very much!


SS Saranya Sivakumar Syncfusion Team October 2, 2015 04:24 AM UTC

Hi Manolo,

Thanks for your update.

Please let us know you have any other queries.

Regards,

Saranya.S


Loader.
Live Chat Icon For mobile
Up arrow icon