- Home
- Forum
- ASP.NET Web Forms
- TreeGrid load data by webmethods
TreeGrid load data by webmethods
I have a question about TreeGrid control:
How to load the data by webmethod like the Grid control with the WebMethodAdaptor?
Thanks!
| //... <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>
//... |
Regards,
Hi Jorge,
Thanks for the update.
Please let us know, if you require any further assistance on this.
Regards,
Dinesh kumar.N
Now, I need to bind the gridtree control with json data clicking on a button, how to do this?
Thanks!
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
It works, but if I want to load a lot of row, it gives an "not enough stack space" error.
Thanks!
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
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!
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
- 9 Replies
- 3 Participants
-
JP Jorge Pampin
- Nov 10, 2015 12:22 PM UTC
- Nov 23, 2015 12:40 PM UTC