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.

Update DetailsRow content from serverside

Thread ID:

Created:

Updated:

Platform:

Replies:

127454 Nov 16,2016 09:26 AM Nov 17,2016 05:54 AM ASP.NET Web Forms 1
loading
Tags: TreeGrid
GUYOT
Asked On November 16, 2016 09:26 AM

Hello,

within DetailsRow i need to display other data than treegrid datasource. For example in tree grid i have a list PC and in DetailsRow i want to display all users of this PC.

How can i achieve this ?

Thank you.

Jonesherine Stephen [Syncfusion]
Replied On November 17, 2016 05:54 AM

Hi Guyot, 
We have prepared the work around and rendered the details template with different data source by using “detailsDataBound” client side event in TreeGrid. 
Please find the code example below: 
<ej:TreeGrid ID="TreeGridcontainer" runat="server" 
            DetailsTemplate="descriptionTemplate" 
            ShowDetailsRowInfoColumn="false" 
            ShowDetailsRow="true" 
            DetailsDataBound="databound"> 
        </ej:TreeGrid> 
<script id="descriptionTemplate" type="text/x-jsrender"> 
            <div id="container{{:Id}}"></div> 
</script> 
<script type="text/javascript"> 
            //Separate data source for resources 
            var resources = []; 
            var x = 0; 
            for (var i = 0; i < 16; i++) { 
                var parent = {}; 
                parent["Id"] = ++x; 
                parent["Name"] = "Resource " + x; 
                resources.push(parent); 
            } 
            function databound(args) { 
                for (var i = 0; i < resources.length; i++) { 
                    if (resources[i].Id == args.data.Id) { 
                        //we can append the required data to details template from here 
                        $("#container" + args.data.Id).append(resources[i].Name); 
                    } 
                } 
            } 
        </script> 
We have also prepared the sample based on this. And fetched the required resource name [separate datasource] for each task by comparing its Id value with TreeGrid Id value. And appended the obtained resource in a details template. Please find the sample from below location  
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ and Syncfusion.EJ.Web dlls to render the TreeGrid control which is available in Essential Studio installed location.   
Please let us know if you require further assistance on this.
Regards, 
Jone sherine P 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.

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.

;