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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set the size by javascript

Thread ID:





123187 Feb 24,2016 04:25 PM UTC Feb 25,2016 12:44 PM UTC ASP.NET Web Forms 1
Tags: TreeGrid
Jorge Pampin
Asked On February 24, 2016 04:25 PM UTC


How to change the size of a TreeControl by JavaScript?


Mahalakshmi Karthikeyan [Syncfusion]
Replied On February 25, 2016 12:44 PM UTC

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" />


<script type="text/javascript">

        $("#size").click(function () {

            var obj = $("#Treegrid").data("ejTreeGrid");

            var size = { width: '500' } ;

            obj.setModel({ "sizeSettings": size })



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


Mahalakshmi K.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon