Hi,

We can’t disable sub grid using out of the box “setDisabled” method.

But there is an unsupported way to disable the grid.

Actually sub grid renders as HTML Span, so we can disable the span using below function

function disableSubgrid(subgridName) {

var subGrid = document.getElementById(subgridName + “_span”);

if (subGrid) {

subGrid.disabled = “true”;

}

}

How Do I call this method :-

  • If your subgrid name is “gridContacts”, Pass the name to the function disableSubgrid(“gridContacts”)

Hope it helps 🙂

Advertisements
Advertisements

3 responses to “Disabling sub grid using jscript in CRM 2011”

  1. Jorge Avatar
    Jorge

    Thanks a lot!!

  2. Hector Avatar
    Hector

    Would there be another way to not show the subgrid ribbon when the subgrid is clicked? I know disabling the subgrid does this but its grays out the text and disables the search box if I have it added. I want to be able to click the subgrid and make it so the ribbon doesnt change and stays with the form ribbon. Thanks

    1. Rajeev Pentyala Avatar

      We can enable\disable subgrid ribbon buttons using EnableRule.
      Suppose you have a subgrid in an form which become readonly, now you can disable subgrid ribbon buttons based on current form state.

Leave a reply to Rajeev Pentyala Cancel reply