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

TreeSet Datasource

Thread ID:

Created:

Updated:

Platform:

Replies:

120922 Oct 27,2015 05:33 AM UTC Oct 29,2015 11:49 AM UTC ASP.NET Web Forms 3
loading
Tags: DropDownList
Prasanth
Asked On October 27, 2015 05:33 AM UTC

Hi there,

Is it possible to have drop down filled in based on datasource which has tree structure data set (stored in database).

And display / render it with either
  1. Check-box options 
  2. Single selection based option

Regards
Prasanthan

Saranya Sivakumar [Syncfusion]
Replied On October 28, 2015 01:01 PM UTC

Hi Prasanthan,

Thanks for contacting Syncfusion support.

We can bind the Treestructured data to the Dropdownlist control with the checkboxes using ContentTemplate API. Using ContentTemplate we can define the customized structure for the content of the Dropdownlist control as shown in the following code snippet.

<code>

<ej:DropDownList ID="selectFolder" runat="server" ClientIDMode="Static" Width="280px" PopupWidth="280px" PopupHeight="280px" WatermarkText="Select any value">

                <Items>

                    <ej:DropDownListItem>

                        <ContentTemplate>

                            <ej:TreeView ID="Treeview" runat="server" DataTextField="Text" ClientIDMode="Static" DataIdField="ID" DataParentIdField="ParentID"

                                DataHasChildField="HasChild" ClientSideOnNodeExpanded="checkScroll" ClientSideOnNodeChecked="onNodeCheck" ClientSideOnNodeUnchecked="onNodeUnCheck" ClientSideOnNodeSelected="onNodeSelect" ShowCheckbox="true" ClientSideOnNodeCollapsed="checkScroll">

                            </ej:TreeView>

                        </ContentTemplate>

                    </ej:DropDownListItem>

                </Items>

            </ej:DropDownList>

</code>

We have prepared the simple sample Dropdownlist with Treeview along with checkbox enabled and the same can be downloaded from the following location.

Sample Location: Sample

Regards,

Saranya.S


Prasanth
Replied On October 28, 2015 01:11 PM UTC

Hi Saranya,

Thanks for the reply, I thought I have posted the question on ASP.NET MVC forum, I wanted to know how this can be achieved in ASP.NET MVC.  I will post the question on correct forum

Here is the ASP.NET MVC forum thread link, if you have an answer for MVC framework please update the forum, otherwise I will wait for an answer 

http://www.syncfusion.com/forums/120928/treeset-datasource

Apologies for the confusion

Regards
Prasanthan

Saranya Sivakumar [Syncfusion]
Replied On October 29, 2015 11:49 AM UTC

Hi Prasanthan,

As per your request we have prepared EJMVC sample for Dropdownlist with Treeview control as datasource and the same can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/120949/ze/DDLMVC311301045

Please let us know if you have any other queries.

Regards,

Saranya.S


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

;