BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Harry,
We can render the multiple TreeGrid in the same page with different id. Also we can bind events to each TreeGrid with different function name to differentiate the functionality for both. Please refer the below code example for details.
@(Html.EJ().TreeGrid("TreeGridContainer"). //… ClientSideEvents(eve => { eve.BeginEdit("beginedit"); eve.EndEdit("endedit"); }). )
@(Html.EJ().TreeGrid("TreeGridContainer1"). //… ClientSideEvents(eve => { eve.BeginEdit("Treegrid2BeginEdit"); eve.EndEdit("Treegrid2EndEdit"); }). )
@(Html.EJ().ScriptManager()) <script type="text/javascript"> function beginedit(args) { var treeGrid1Obj = $("#TreeGridContainer").data("ejTreeGrid"); debugger; //first treegrid begin edit code goes here } function endedit(args) { var treeGrid1Obj = $("#TreeGridContainer").data("ejTreeGrid"); //first treegrid end edit code goes here debugger; } function Treegrid2BeginEdit(args) { var treeGrid2Obj = $("#TreeGridContainer1").data("ejTreeGrid"); //second treegrid begin edit code goes here debugger; } function Treegrid2EndEdit(args) { var treeGrid2Obj = $("#TreeGridContainer1").data("ejTreeGrid"); //second treegrid end edit code goes here debugger; } </script> |
We have also prepared a sample based on this. And you can find the sample under the following location.
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/MultipleTreeGrid1399200820
Regards,
Mahalakshmi K.
We have analysed the reported issue with our sample. We are unable to reproduce the issue. Whether are you trying to use any kind of container control for rendering the Treegrid controls? And we have also prepared sample with the below configuration setup.
MVC version |
MVC 5 |
Visual studio version |
VS 2013 |
.Net framework |
4.5 |
Syncfusion version |
13.2.0.39 |
Can you please revert us by modifying the sample based on your application along with the replication procedure?
Sample Location: http://www.syncfusion.com/downloads/support/forum/120743/ze/Mvc5TreeGridSample-286212925
Please let us know if you need more information on this.
Regards,
Jayakumar Duraisamy
Hi Harry,
We have analyzed your sample and came to know that, the scripts are referred 2 times for the 2 controls separately, that’s why we got exception, since both are same control not need to call the layout page 2 times in the sample, please remove the _Layout page call from the “_ViewStart.cshtml”. We have also modified the sample and you can find the sample under the following location.
Regards,
Mahalakshmi K.
Hi Harry,
The reported issue in your previous update occurred due to the multiple script reference for the same control. So we have removed the reference from the view layout page then the script was referred once in the main view page alone and the issue was resolved for us and the provided sample by us in our previous update is also working fine at our end. But analyzing further on all possibilities to reproduce the issue you are facing, we were not able to reproduce it. So it would be helpful for us if you provide us your sample in which you are facing the issue or please modify the sample provided by us, along with replication procedure to reproduce the issue, so that we could provide you the solution at the earliest.
Regards,
Mahalakshmi K.