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.

TreeGrid load data by webmethods

Thread ID:

Created:

Updated:

Platform:

Replies:

121095 Nov 10,2015 07:22 AM Nov 23,2015 07:40 AM ASP.NET Web Forms 9
loading
Tags: TreeGrid
Jorge Pampin
Asked On November 10, 2015 07:22 AM

Hello,

I have a question about TreeGrid control:

How to load the data by webmethod like the Grid control with the WebMethodAdaptor?

Thanks!



John Rajaram [Syncfusion]
Replied On November 12, 2015 08:10 AM

Hi Jorge,
Thanks for using Syncfusion products.
At present there is no support for WebMethodAdapter in TreeGrid control. For this we have already logged a feature request regarding this.
A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

But we can load the data to TreeGrid control from web method through ejDataManager control with the help of following code snippets.
Code snippets:

//...
<ej:TreeGrid runat="server" ID="TreeGridControlEditing" TreeColumnIndex="1" 
            EnableResize="true" IdMapping="TaskId" ParentIdMapping="ParentId" Load="Load">            
          <columns>
                <ej:TreeGridColumn HeaderText="Task Id" Field="TaskId" Width="55" EditType="Numeric"/>
                <ej:TreeGridColumn HeaderText="Task Name" Field="TaskName" EditType="String"/>
                <ej:TreeGridColumn HeaderText="Start Date" Field="StartDate" EditType="Datepicker"/>
                <ej:TreeGridColumn HeaderText="End Date" Field="EndDate" EditType="Datepicker"/>
                <ej:TreeGridColumn HeaderText="Duration" Field="Duration" EditType="Numeric" />
                <ej:TreeGridColumn HeaderText="Progress" Field="Progress" EditType="Numeric"/>
         </columns> 

    //...

</ej:TreeGrid>
          <script>
              function Load() {
                  var data = ej.DataManager({ url: "http://mvc.syncfusion.com/ProjectDataService/ProjectDataService.svc/ProjectDatas"});
                  var obj = $("#TreeGridControlEditing").data("ejTreeGrid");
                  obj.model.dataSource = data;
              }
          </script>

//...


Please let us know if you require further assistance on this.
Regards,
John R


Jorge Pampin
Replied On November 12, 2015 10:50 AM

Ok, thank you! It's enough.

Dinesh Kumar Nagarathinam [Syncfusion]
Replied On November 13, 2015 07:10 AM

Hi Jorge,

Thanks for the update.

Please let us know, if you require any further assistance on this.


Regards,

Dinesh kumar.N


Jorge Pampin
Replied On November 18, 2015 12:12 PM

Hello,

Now, I need to bind the gridtree control with json data clicking on a button, how to do this?

Thanks!

Dinesh Kumar Nagarathinam [Syncfusion]
Replied On November 19, 2015 10:19 AM

Hi Jorge,
We can bind a json data source while clicking on a button, we have prepared a sample based on your requirement, find the sample from below location.
Sample: http://www.syncfusion.com/downloads/support/forum/121095/ze/TreeGridSample_JSON-885380002
Please let us know, if you need further assistance on this.
Regards,
Dinesh kumar.N

Jorge Pampin
Replied On November 19, 2015 11:13 AM

Hello,

It works, but if I want to load a lot of row, it gives an "not enough stack space" error.

Thanks!

Dinesh Kumar Nagarathinam [Syncfusion]
Replied On November 20, 2015 03:50 AM

Hi Jorge,

We suggest you to increase the maxJsonLength  of jsonSerialization in your web.config file.

Code Snippet:

[Web.Config]

<configuration>

<system.web.extensions>

        <scripting>

            <webServices>

                <jsonSerialization maxJsonLength="90000000" />

            </webServices>

        </scripting>

    </system.web.extensions>

</configuration>



We have prepared a sample based on your requirement, in that we have binded about 6000 Json data. Find the sample from below location.

Sample: http://www.syncfusion.com/downloads/support/forum/121095/ze/TreeGrid_with_large_data-1840095248

Regards,

Dinesh kumar.N


Jorge Pampin
Replied On November 20, 2015 04:16 AM

Hello,

That is no the problem because this is my web.config configuration:

<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483644"/>
      </webServices>
    </scripting>
  </system.web.extensions>

The exception is thrown in this line: treegridObj.option("dataSource", data);

Thanks!


Dinesh Kumar Nagarathinam [Syncfusion]
Replied On November 23, 2015 07:40 AM

Hi Jorge,

We are unable to reproduce the reported issue, we have prepared a sample with 10000 records, can you please revert us by modifying the attached sample with your reported issue? This would be helpful for us to serve you. Find the sample from below location.

Sample: http://www.syncfusion.com/downloads/support/forum/121095/ze/JSON_from_web_metod400368143

Regards,

Dinesh kumar.N


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.

;