Friday, July 20, 2012

Hide some of the field in telerik MVC Grid PopUp edit or any other Edit Mode

Hi there...

Hide any field in telerik mvc grid edit mode. Here is a general idea, may be some error in code as it works perfect for my project but may be different for others.

1. Add a client side event in your grid

.ClientEvents(events => events
                            .OnEdit("onEdit")
                            )

2. Write the onEdit event in javascript

It finds the column name, then you can hide the column by css property.

function onEdit(e) {
     $(e.form).find("#myModelPropertyName").closest(".editor-field").prev().andSelf().remove();
    }

Thanks.

1 comment: