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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The selected item does not display in textbox of GenericDropDown

Thread ID:





107668 Mar 11,2013 11:14 PM UTC Mar 13,2013 04:40 AM UTC ASP.NET MVC (Classic) 3
Tags: Tools
Marie CG
Asked On March 11, 2013 11:14 PM UTC

The selected item (Name) does not display in textbox of GenericDropDown.  The initial value appeared in the textbox but when I make different item in the popup panel, the new item does not show up.  I do not have images in my selection list but I don't think that would make it not working.  Help!

In Controller, I have the following:

            ViewBag.selectedBeforeEvents = db.Ratings.Where(e => e.Type == 1 && e.Scale == threat.LOIBeforeEvent).Single().Name;
            ViewBag.LOIBeforeEvents = db.Ratings.Where(e => e.Type == 1).ToList();

In View, I have the following:

 @{List<gThiraMetrix.Models.Rating> LOIBeforeEventList = ViewBag.LOIBeforeEvents;
       string selectedBeforeEvent = ViewBag.selectedBeforeEvents;

Meena [Syncfusion]
Replied On March 12, 2013 05:15 AM UTC

Hi Marie,


Thanks for contacting Syncfusion forums.


Your requirement of updating the text of selected item in GenericDropdown textbox can be achieved using the “setText()” client side method. Please refer the below code snippet,



@{Html.Syncfusion().GenericDropDown("myGenericDropDown").ClientSideOnClick("ClientSideOnClick").Render();}                    // This event will be triggered on item select




function ClientSideOnClick(sender, args) {

        var text = "";

        if (args._target.nodeName.toLowerCase() == "img")

            text = $(args._target.parentNode).text().trim();


            text = args._text;

        sender.setText(text);                                                                                                  // This method will set the text in textbox





We have also prepared a simple sample with GenericDropdown with databinding as per your code snippet and it can be downloaded from the below link.


Kindly have a look at the sample and let us know if your requirement is met.





Marie CG
Replied On March 12, 2013 06:57 PM UTC

Thank you.  It is working.

Meena [Syncfusion]
Replied On March 13, 2013 04:40 AM UTC

Hi Marie,


Thanks for the update.


We are glad to know that your issue has been solved. Kindly get back to us if you need further assistance.


We will be happy to help you out.





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