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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

allow editting some columns

Thread ID:

Created:

Updated:

Platform:

Replies:

119650 Jul 17,2015 04:04 PM UTC Jul 21,2015 12:50 PM UTC ASP.NET MVC 3
loading
Tags: TreeGrid
Harry Zheng
Asked On July 17, 2015 04:04 PM UTC

Hi,

I wonder if the treegrid in asp.net mvc has the feature allowing user edit some columns but not others.
Right now, user can edit every column in the treegrid, but we do not want them to edit some columns.
Thanks,

Harry

Mahalakshmi Karthikeyan [Syncfusion]
Replied On July 20, 2015 09:49 AM UTC

Hi Harry,
For your kind information, we can cancel the editing for particular fields in TreeGrid with the help of “BeginEdit” client side event. Please refer the below code snippet to cancel the editing for particular column.

 


@ (Html.EJ ().TreeGrid ("TreeGridContainer").

       EditSettings(eve =>

       {

           eve.AllowEditing(true);

           eve.AllowAdding(true);

           eve.AllowDeleting(true);

           eve.EditMode(TreeGridEditMode.CellEditing);      

       }).

       ClientSideEvents(eve=>{

           eve.BeginEdit("beginEdit");

       }).

      //...

  )


<script type="text/javascript">

        function beginEdit(args) {

            var treeObj = $("#TreeGridContainer").data("ejTreeGrid");

            var columns = treeObj.model.columns;

//cancelling editing for 'StartDate' column and 'PercentDone' column

            if (columns[args.columnIndex].field == "StartDate" || columns[args.columnIndex].field == "PercentDone")

               args.cancel = true;

        }

    </script>



We have also prepared a sample prepared a sample based on this and you can find the sample under the following location

Sample: http://www.syncfusion.com/downloads/support/forum/119650/ze/CellEditing202526131

Also currently there is no support to cancel editing a row for editMode as “RowEditing”. We have also logged an improvement task to cancel editing the row  in “RowEditing” mode. 

A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.


Regards,

Mahalakshmi K.


Harry Zheng
Replied On July 20, 2015 02:29 PM UTC

Hi Mahalakshmi,

Thank you for your solution. It works well to limit the columns not allowed to edit.
I tried your sample by commenting out  "TreeGridToolBarItems.Edit" in ToolBarSettings (since we do not want user to edit row using edit in toolbar), it gives a webpage error when I try to edit a cell in "Duration" column.  Please see attached file for screenshots.
I wonder if this could be fixed.
Thank you,

Harry

Attachment: HZ20150720_dbf3953.rar

Mahalakshmi Karthikeyan [Syncfusion]
Replied On July 21, 2015 12:50 PM UTC

Hi Harry,

Sorry for the inconvience caused.

We can also reproduce the issue while disabling edit icon in the toolbar and enabling the cellEditing in TreeGrid. A support incident has been created under your account to track the status of this issue report. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.

Regards,

Mahalakshmi K.


CONFIRMATION

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.

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

;