web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Disable an editable field in the Power Apps Grid Control feature.

(0) ShareShare
ReportReport
Posted on by 105

I'm currently using the out of the box 'Power Apps Grid Control' pcf on a subgrid to display child records. This is ideal as I need to show option set colours and allow the users to edit the data inline.

I have the 'editable' option set to 'Yes' but there is one field in the subgrid I want to prevent users from editing.

I have tried numerous methods mentioned online including using a 'business rule' and javascript.

However, none of these methods seems to be affecting it and I'm wondering if these would traditionally be used with the 'Editable Grid' control as opposed to the 'Power Apps Grid Control'.

Has anyone come across this before and can they advise how this can be done? There is also a chance I could be implementing these changes incorrectly and they work fine for others?

I have the same question (0)
  • Community Member Profile Picture
    on at

    cool

  • Leco Lv Profile Picture
    on at

    Hi partner,

    I think Js should be able to do it (setDisabled ), can you provide your code?

    GridCell (Client API reference) in model-driven apps - Power Apps | Microsoft Learn

  • AMD99 Profile Picture
    105 on at

    Hi, below is the code I'm using, triggered when a record is selected in the subgrid UI.

    function fnLockFields(executionContext) {

       let oFormContext = executionContext.getFormContext();

       if (oFormContext) {

           let arrFields = ["new_currentstatus"];

           let objEntity = oFormContext.data.entity;

           objEntity.attributes.forEach(function (attribute, i) {

                  if (arrFields.indexOf(attribute.getName()) > -1) {

                     let attributeToDisable = attribute.controls.get(0);

                     attributeToDisable.setDisabled(true);

                  }

           }

    )};

    }

    pastedimage1671009344302v1.png

  • AMD99 Profile Picture
    105 on at

    I just tested my code on the regular 'Editable Grid' control and it works. But does not work with the 'Power Apps Grid Control'

  • Verified answer
    Leco Lv Profile Picture
    on at

    Hi partner,

    I noticed that this is a preview function, and maybe only the following two types are currently supported.

    Power Apps grid control(preview): learn.microsoft.com/.../the-power-apps-grid-control

    pastedimage1671096635587v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 93

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans