Disabling sub grid using jscript in CRM 2011
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 🙂
Categories: CRM 2011, JScript
CRM 2011, disable subgrid, subgrid
Thanks a lot!!
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
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.