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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

To trim the long value displayed in the drop downs

Thread ID:





141138 Nov 26,2018 12:02 PM UTC Nov 27,2018 07:06 AM UTC ASP.NET MVC - EJ 2 1
Tags: DropDownList
Asked On November 26, 2018 12:02 PM UTC

The field (associated with dropdown) has limit of 200 characters (refer to the attached file).
We want to trim this value while displaying in dropdown and want to implement a tool tip on hover over which will display whole text. Please suggest the solution.

Attachment: Dropdownissue_72379f74.rar

Prince Oliver [Syncfusion]
Replied On November 27, 2018 07:06 AM UTC

Hi Sharad, 
Thank you for contacting Syncfusion support. 
To trim the values in the DropDownList and show the values on tooltip, you can render the tooltip control for the DropDownList and use its BeforeRender event to set the value as the tooltip content. Kindly refer to the following code snippet. 
    @Html.EJS().DropDownList("dropdowns").Width("300px").Placeholder("Select a value").Value((string)ViewBag.value).DataSource((object)ViewBag.data).Fields(new DropDownListFieldSettings 
   { Text = "Name", Value = "Eimg" }).Render() 
    function onBeforeRender(e) { 
        let value = document.getElementById('dropdowns').ej2_instances[0].text; 
        this.content = value; 
We have attached a sample for your reference, please find the sample at the following link: http://www.syncfusion.com/downloads/support/forum/141138/ze/dropdownlist2098451702 
Please let us know if you require any further assistance on this. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon