Multiple lines of code in if statement without curly braces
The problem with massively nested if statements without the { } is that it is a fragile structure. It is easy to come in and add a new statement and not realize whether it is or is not in one of the ifs or not. It also makes else statements harder to follow as not everyone is completely familiar with the precedence rules for else statements.

It works, it's entirely valid code - but it is bad style.

In this particular case you don't even need the nested ifs:

if (ggcCompareGrid.TopLevelTable != null)
{
        foreach (GridRow row in ggcCompareGrid.TopLevelTable.Rows)
        {
            if (row.DisplayElement.ParentGroup != null &amp;&amp; 
                  row.DisplayElement.ParentGroup.Category != null &amp;&amp; 
                  (int)row.DisplayElement.ParentGroup.Category == key &amp;&amp; 
                   row.Record == null)
            {
                  row.DisplayElement.ParentGroup.IsExpanded = false;
                  break;
            }
        }
  }


You could also consider in this case having a private boolean function that does the comparison:

 private boolean checkParentGroup(ParentGroup group, int key, Record record) {
      return ((group != null) &amp;&amp; (group.Category != null) &amp;&amp; 
                  ((int)group.Category == key) &amp;&amp; 
                   (record == null))
 }

if (ggcCompareGrid.TopLevelTable != null)
{
        foreach (GridRow row in ggcCompareGrid.TopLevelTable.Rows)
        {
            if (checkParentGroup(row.DisplayElement.ParentGroup, key, row.Record)
            {
                  row.DisplayElement.ParentGroup.IsExpanded = false;
                  break;
            }
        }
  }


This makes every part of the code simpler and clearer.

Obviously the checkParentGroup method should have a better name though, describing what it is actually checking.