Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Disable a Specific Cell in IgxGrid – How To

Disable a Specific Cell in IgxGrid – How To

New Discussion
Prabu kuppusamy
Prabu kuppusamy asked on May 14, 2020 7:32 AM

Hi,

Is it possible to disable particular cell from editing? we need to disable the cell based on the conditions.

We need disable only cell not entire row or column.

I couldn’t find exact option in the documentation,

Kindly provide if any samples available.

Thanks

Sign In to post a reply

Replies

  • 0
    Martin Evtimov
    Martin Evtimov answered on May 12, 2020 7:51 AM

    Hello Prabu,

    Thank you for contacting Infragistics Community!

    I believe you will find the following sample very helpful in order to achieve the required. As you can observe I’m listening to the onCellEditEnter event and based on some condition I cancel this event for specific cells (not entire rows or columns).

    Please let me know if you need any further information.

    Best Regards,
    Martin Evtimov
    Entry Level Software Developer
    Infragistics, Inc.

    • 0
      Prabu kuppusamy
      Prabu kuppusamy answered on May 12, 2020 4:50 PM

      Thanks for you response,

      Actually, we cannot use [rowEditable]="true" as per our design requirement we cannot use explicit cell edit. 

      and I have tried with my example, and we are having (onCellEdit) on grid level, in this method I couldn't access the below line which is mentioned in your example.

      if (this.grid.rowInEditMode) {
                  this.grid.endEdit(true);
      }
      this is our column config we dynamically preparing and passing to the grid.
      field: "layerDescription"header: "Layer Description"type: "string"width: "150"editable: true 
      So, from the above config, we are making column editable, 

      Is there any other way to achieve the cell disable except by onCellEditEnter?

      • 0
        Martin Evtimov
        Martin Evtimov answered on May 13, 2020 9:21 AM

        Hello Prabu,

        Thanks for your reply!

        I have modified the sample according to the details provided so that entering edit mode happens via setting columns editable property to true instead using [rowEditable]=”true”. In the previous response, I have sent a link to the Editing Events and as you can see onCellEdit fires when a cell's value is committed (thus it isn’t possible to disable the cell editing using this event). This event is used for example to check if an invalid value has been committed and to discard the change. On the other hand, onCellEditEnter fires when a cell enters edit mode and, as demonstrated in the sample, based on some condition we can cancel this event (disable the cell editing mode). When not using row editing we must omit the “this.grid.rowInEditMode” conditional check. As you can observe (for example try editing “Units to order” on the first row when in editing mode) simply by canceling the onCellEditEnter makes the gird automatically exit the edit mode.

        Please let me know if you need any further information.

        Best Regards,
        Martin Evtmov
        Entry Level Software Developer
        Infragistics, Inc.

      • 0
        Prabu kuppusamy
        Prabu kuppusamy answered on May 13, 2020 4:13 PM

        Thank you so much..  it's working perfect, you really helped me a lot.

        I have tried with my application, working fine.

        Thanks again. [emoticon:9b06bfad0e6a482e801e5eb8fd9025d6]

      • 0
        Martin Evtimov
        Martin Evtimov answered on May 14, 2020 7:32 AM

        Hello Prabu,

        I am glad that you managed to achieve your requirement with my suggestion.

        Thank you for using Infragistics components!

        Best Regards,
        Martin Evtimov
        Entry Level Software Developer
        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Prabu kuppusamy
Favorites
0
Replies
5
Created On
May 14, 2020
Last Post
5 years, 10 months ago

Suggested Discussions

Created by

Created on

May 14, 2020 7:32 AM

Last activity on

Feb 11, 2026 3:08 PM