Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
Enable different column for add and edit
posted

Hello, need a little help here.

For example, I have 4 column (A, B, C, D). If I want to edit, user only can edit column D. But if user add row, all column can be fill in.

How can I achieved that with IgniteUI 2016.2 and ASP.MVC 5 ?

Parents
  • 15320
    Verified Answer
    Offline posted

    Hello Johnson,

    You can achieve this on editCellStarting event, where you can check whether the operation is rowadding or editing and based on that to cancel the event. For example:

    editCellStarting: function(evt, ui) {
          if(ui.rowAdding) {
           return true;
          } else {
           if(ui.columnKey == "ProductID" || ui.columnKey == "Name") {
            return false;
           }
          }
          
         },

    Attached is also a sample for your reference.

    If you have any further questions, please let me know.

    Regards,
    Tsanna

    readOnlyColumns.zip
Reply Children