Hi Jorge,
We can set the size to TreeGrid using javascript with the help of setModel. Please refer the below code example for details.
<button id="size">Change Size</button>
<ej:TreeGrid ID="Treegrid" runat="server" //… >
//…
<SizeSettings Width="100%" Height="500px" />
</ej:TreeGrid>
<script type="text/javascript">
$("#size").click(function () {
var obj = $("#Treegrid").data("ejTreeGrid");
var size = { width: '500' } ;
obj.setModel({ "sizeSettings": size })
})
</script>
|
Here at the load time we have rendered the TreeGrid width as 100% to the document and at the button click we have changed the TreeGrid width as 500 pixel using setModel.
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/SizeSettings905695090
Note: 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
Regards,
Mahalakshmi K.