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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard