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
590
Grid Load event
posted

Hi,

I want a small clarification on one use case related to IgrDataGrid (https://ko.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).

We want to enable/disable cells in the grid based on rows preferably when rows are bound to the grid(when grid data is loaded). Currently, we are achieving this during the cell click event but it has its issues. I also didn't come across any other event which will work after the grid load. Please can you provide a demonstration to achieve the above tasks?

Hoping for a positive response.

Thanks!

  • 34830
    Offline posted

    Hello Shubham,

    I have been investigating into the behavior you are looking to achieve in this case, and I am under the impression that you are looking to enable/disable cells to the end that you are looking to prevent editing of them. If this impression is incorrect, please let me know.

    If my above impression is correct, then the current way you are going about it is very likely the best way. The columns of the IgrDataGrid expose a dataBound event to get when each cell binds its data, but there is nothing exposed on that event to enable/disable a particular cell or prevent editing of it. This behavior is controlled purely by the column’s isEditable property, but this will apply to all cells in that column and so to get a more dynamic level of edit-ability, you need to toggle the isEditable on the columns.

    I am unsure of the “issues” you are hitting with the cell click event, but perhaps using the activeCellChanged event on the grid would be better here for you? This would allow you to check the previously active cell of the grid to see if the row is different. If it is, you can then set the isEditable property of the columns in your grid accordingly.

    Please let me know if you have any other questions or concerns on this matter.