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

GenericDropDown Select the first item displayed by default?

Thread ID:

Created:

Updated:

Platform:

Replies:

109601 Jun 21,2013 01:11 PM UTC Jun 24,2013 11:13 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: Tools
zsy619
Asked On June 21, 2013 01:11 PM UTC

GenericDropDown loaded, select the first item?

Gurunathan A [Syncfusion]
Replied On June 24, 2013 11:13 AM UTC

Hi,

Thanks for contacting Syncfusion.

To get the first child text in generic dropdown control when page loads,  we suggest you to use clientside event "ClientSideOnLoaded". Please refer the following code snippet.

<code>

[.cshtml]

@{Html.Syncfusion().GenericDropDown("myDropDown").Width(300).TargetContentId("drop-down-contents").ClientSideOnClick("ClientSideOnClick")

.PopupPanelWidth(300).ClientSideOnLoaded("ClientSideonLoad").Render(); }

 

<script type="text/javascript">

        function ClientSideonLoad(sender, args) {//debugger

           var ddtext = $("div.gddChildItem:first")[0].firstChild.data;

           sender.setText(ddtext);

    }

</script>

</code>

Kindly let us know if you have further queries.

 

Warm Regards,

Gurunathan A



Gdd_dropdown_888bdbdb.zip

CONFIRMATION

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.

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

;