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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model driven app with ...
Power Apps
Unanswered

Model driven app with editable Grid - Enable editing data on choice field selection of the same record

(0) ShareShare
ReportReport
Posted on by 2

Hi

I have a model driven app with an editable grid to edit the data. The user can now edit the data when clicking into the different cells of the grid. 

 

To avoid data changes by accident we would like to initially disable editing of grid data and add enable editing of grid data only when a choice field value is changed, for example. Edit(Column name) field with Yes/No options, when yes is selected, only then enable fields to edit/insert the data. I have written below code but it is working as expected. Any suggestions would be highly appreciated, thank you.

 

var formContext = executionContext.getFormContext();
    var gridContext = formContext.getControl("edgrid_typeofworks");
    var isApplicable = false;
    var setDisabledValue = true;
    let allRows = gridContext.getGrid().getRows();
    allRows.forEach(function(row){
        let attributes = row.data.entity.attributes;

        attributes.forEach(function(rowData){
            rowData.controls.forEach(function(field){
                if(field._controlName === "tco_msa_applicable"){
                    field.setDisabled(false);  
                   
                }else{
                field.setDisabled(setDisabledValue);
                }
            });
        })
Categories:
  • ramanjjilu27861 Profile Picture
    2 on at

    Even after 50 views, no body in the community/ forum has an answer??

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard