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

Maxlength property

Thread ID:





121885 Feb 3,2016 06:05 PM UTC Feb 4,2016 12:41 PM UTC ASP.NET Web Forms 1
Tags: TreeGrid
Jorge Pampin
Asked On February 3, 2016 06:05 PM UTC


How to set maxlength property when the edit type is string?


Mahalakshmi Karthikeyan [Syncfusion]
Replied On February 4, 2016 12:41 PM UTC

Hi Jorge,

We can achieve this requirement with workaround by binding the keypress event to the unique id of editing element. Please refer the below code example for details.

<ej:TreeGrid ID="Treegrid" runat="server" EnableResize="true" //… >



<script type="text/javascript">


        $(document).on("keypress", "#TreegridName", function (e) {

            var CharLength = $(e.target).val().length + 1;

            if (CharLength > 5) {             

                e.returnValue = false;

                if (e.preventDefault)





In the above we have restricted the “Name” field to enter above 5 characters. 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/Maxlength-143303496


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

This page will automatically be redirected to the 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