Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

disable subgrid

(0) ShareShare
ReportReport
Posted on by 2,508

Hi, are we able to disable the subgrid through javascript or something, so that user can not click, 

*This post is locked for comments

  • Alphateck Profile Picture
    5 on at
    RE: disable subgrid

    You can disable an editable subgrid control by first grabbing the grid control (also referred to as the grid context) which is similar to grabbing any other control.  Then disable the grid context.  It's even in Microsoft's Client API online documentation:

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/grids/gridcontrol

    setDisabled() is listed as an available call for the grid control.

    let disableGrid = function (formContext) {

           let gridContext = formContext.getControl("GridsName");

           gridContext.setDisabled(true);

       };

    However, you can still drill into listed records.  You cannot stop that.

  • Gran Torino Profile Picture
    5 on at
    RE: disable subgrid

    function disableGrid(id, isDisabled) {
        const blocker = parent.$('
    '); !!isDisabled ? parent.$('#' id '_span').prepend(blocker) : parent.$('#' id '_blocker').remove(); }

  • Community Member Profile Picture
    on at
    RE: disable subgrid

    setDisabled is not available on a subgrid control.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: disable subgrid

    Hi,

    if you want to achieve this behavior give the users only the read privileges on the linked entity.

  • sdnd2000 Profile Picture
    2,508 on at
    RE: disable subgrid

    the code can not get the subgrid

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: disable subgrid

    Hi,

    You can use the following Javascript code and register the function on-load of the form.

    function DisableSubgrid() {   
        var subGridCtrl = Xrm.Page.getControl("SubgridName");
    
        // If subgrid is not loaded yet, then call same function after some time.
        if (subGridCtrl == null) {
            setTimeout(DisableSubgrid, 1000);
            return;
        }
    
        // Disable the subgrid control
        subGridCtrl.setDisabled(true);
    }

    Hope this helps.

  • Suggested answer
    pavanmanideep Profile Picture
    1,331 on at
    RE: disable subgrid

    Hi,

    Disabling a subgrid is not supported to say exactly.

    You can go through these links below for more information..

    crmbusiness.wordpress.com/.../crm-2013-disabling-a-subgrid

    community.dynamics.com/.../197142

    Hope this helps...

    Thank you.

    Regards,

    Mani Deep Y

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans