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. Image for the cookie policy date

Restrict Character Limit for Task Name


Need your help on priority bases. As we are working on commited delivery,I would like to know how can I put character limit for Task Name.

e.g.If we have Task Name character limit like 30 so user can not add more than 30 character into Task Name.

if User can paste more than 30 character than user can not paste more than 30 character.

Is there any property or some other way available in Gantt control ? Awaiting your prompt response in this regard.

Attachment: Allowcharacter_cef2c78.zip

3 Replies

SR Suriyaprasanth Ravikumar Syncfusion Team August 9, 2017 09:46 AM UTC

Hi Kuntal 
We have prepared a sample and achieved your requirement by using “BeginEdit” and “ActionBegin” client side event. 
We can set maximum length of characters for input box by using “maxlength” attribute. While cell editing and dialog add/edit action we can set maxlength attribute for input element of task name field 
using “BeginEdit” and “ActionBegin” events.  
Please refer the following code snippets. 
             .ClientSideEvents(cs => 
    <script type="text/javascript"> 
//Event trigger at the cell edit 
        function BeginEdit(args) { 
            if (args.columnIndex == 1) { 
                $(args.cellElement).focusin(function (arg) { 
                    $("#" + arg.target.id).attr('maxlength', '15'); 
        //Event trigger at the dialog edit 
        function ActionBegin(args) { 
            if (args.requestType == "beforeOpenEditDialog") { 
                $("#GanttContainertaskNameEdit").attr('maxlength', '15'); // GanttContainer is id of Gantt control 
Please find the sample from following location. 
Suriyaprasanth R. 

KP Kuntal Patel August 9, 2017 10:56 AM UTC

Thanks it's working fine.

can you please give us references URL from where we can find this kind of solution with example.

SR Suriyaprasanth Ravikumar Syncfusion Team August 10, 2017 09:52 AM UTC

Hi Kuntal, 
Thanks for your update. 
Currently we are documented the solution for generic features and workarounds available in Gantt, for user specific requirement we will provide solution by forum and support incidents. 
Please refer the following link to know more about Gantt control. 
Please refer the below link to get details about available properties, methods and client side events in Gantt. 
Please let us know if you need any other assistance.  
Suriyaprasanth R

Live Chat Icon For mobile
Up arrow icon