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.

Two GenericDropDown How to achieve linkage?

Thread ID:

Created:

Updated:

Platform:

Replies:

109600 Jun 21,2013 09:10 AM Jun 27,2013 04:48 AM ASP.NET MVC (Classic) 1
loading
Tags: Tools
zsy619
Asked On June 21, 2013 09:10 AM

Two GenericDropDown   实现联动效果??

Sunil Prabakar C [Syncfusion]
Replied On June 27, 2013 04:48 AM

Hi Customer,

 

Thanks for contacting Syncfusion support.

 

Since we are not able to get your requirements clearly. We make simply the hierarchy between two generic dropdown to achieve linkage between two generic dropdown. To achieve this use the  “OnTextChanged” serverside event for primary dropdown. And using this event bind the values for secondary dropdown. Please refer the following code snippet.

 

<Code>

 

[ASPX]

 

<syncfusion:GenericDropDown ClientObjectId="Generic" AutoPostBackOnTextChanged="true"

            ID="GenericDropDown1" runat="server" Width="150px" OnTextChanged="GenericDropDown1_TextChanged">

 

[CS]

 

   protected void GenericDropDown1_TextChanged(object sender, Syncfusion.Web.UI.WebControls.Shared.GenericDropDownTextChangeEventArg e)

    {

        if (GenericDropDown1.Text == "Tools")

        {

            TreeViewNode node1 = new TreeViewNode();

            node1.ID = "tools1";

            node1.Text = "ASP";

            TreeViewNode node3 = TreeView2.Items[0];

            node3.Text = "Tools";

            node3.Items.Add(node1);

        }

        else

        {

            gdd.Text = "-Select-";

            TreeView2.Items.Clear();

        }

    }

 

</Code>

 

For your reference we have prepared the sample to exhibit this behavior, its available in below link.

 

GDD.zip

 

If your requirement is different form hierarchy generic dropdown, kindly let us know with further more details.


Thanks & Regards

Sunil Prabakar C


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.

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.

;