What is Issue?
This can not be achieve using out-of-box subgrids controls.
There are 2 solution for this-
1. Go with HTML webresource.
2. Create Your own Custom Control using PCF (PowerApps Control Framework)
I created the completely read-only subgrid with pagination functionality similar to out-of-box subgrid.
Taking my current scenario-
I have to make subgrid completely read-only if the “More Contact Required?”= NO
Or else the subgrid will be normal subgrid.
So what I did –
- On form I added 2 similar subgrids with different Names.
- Added script on change of “More Contact Required?” field to show required subgrid.
- Changed the control for subgrid which is visible when “More Contacts Required?”= NO
Open Form Editor -> Select Subgrid -> Change Properties -> Controls Tab ->Add Control -> Selected my own custom Control ->ReadOnlySubgridPage -> Click Add
- Save Form and Publish.
Now I found it so simple as I can make any subgrid readonly with my custom control.
You can download the Solution from here and import in Dynamics 365 to use the control.
If you want to check source code download from here.
To work with source code you need some of the basic setup in your computer-
1. Nodejs installed
2. VS or Visual Studio Code installed
3.Understanding of below commands-
pac pcf init --namespace yourNamespace --name yourControlName --template dataset npm install npm run build npm start pac solution init --publisher-name yourPubliserName --publisher-prefix yourPrefix pac solution add-reference --path "pcfproj folder path" msbuild /t:restore msbuild
Hope this will help…
Enjoy Ms CRM!!!
Follow on Facebook- FB: MSCRM16Tech