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
15
Ignite UI Grid cell protection
posted

Hello,

I am creating an Ignite UI Grid in Angular application. I need to protect(make non-editable) some specific cells,
is there a way to make some cells read-only ?

Thank you in advance,
Daniel

Parents
  • 1320
    Verified Answer
    Offline posted

    Hello Daniel,

    After investigating this further, I determined that cells are not editable by default. However if editable=”true” is added to the column tag, every cell in the column is editable. Your request could be achieved if a method is bound to the onCellEditEnter event:

    <igx-grid  #workDataGrid  id="workDataGrid"  [data]="data1"  [height]="'480px'"  [width]="'640px'"  [autoGenerate]="false" [primaryKey]="'ID'"  (onCellEditEnter)="editing($event)" >

    In this method if the clicked cell is in the collection of cells, which should not be editable, the event could be canceled:

     public editing(evt){

        this.cells.forEach(x=>{

          if(evt.cellID.rowID === x.rowID && evt.cellID.columnID === x.columnID){

          evt.cancel = true;

        }

        });    

      }  

    I have prepared a sample demonstrating the described behavior.

    Please let me know if you need additional information regarding this matter.

    Regards,

    Monika Kirkova,

    Infragistics

Reply Children