Home > CRM 2011, JScript > Disabling sub grid using jscript in CRM 2011

Disabling sub grid using jscript in CRM 2011


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 🙂

  1. Jorge
    May 14, 2012 at 3:43 PM

    Thanks a lot!!

  2. Hector
    February 7, 2014 at 7:00 PM

    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

    • February 12, 2014 at 2:28 PM

      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.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: