protected override void DisposeManagedResources()
 {
     base.DisposeManagedResources();
     this.DisposeLinks();
     this.UnbindRowProperties();
     if (this.DataCell == null || this.stackLayoutElement.IsDisposed)
     {
         return;
     }
     this.DataCell.Children.Remove((RadElement)this.stackLayoutElement);
     this.stackLayoutElement.Dispose();
     this.stackLayoutElement = (StackLayoutElement)null;
     this.expander           = (GridTreeExpanderItem)null;
 }
        public SelfReferenceCellLayout(GridRowElement rowElement)
        {
            this.rowElement         = rowElement;
            this.hierarchyLinks     = new List <GridLinkItem>();
            this.linksCache         = new List <GridLinkItem>();
            this.stackLayoutElement = new StackLayoutElement();
            this.stackLayoutElement.StretchVertically   = true;
            this.stackLayoutElement.StretchHorizontally = true;
            int num = (int)this.stackLayoutElement.SetDefaultValueOverride(RadElement.FitToSizeModeProperty, (object)RadFitToSizeMode.FitToParentBounds);

            this.expander                   = new GridTreeExpanderItem(rowElement.TableElement);
            this.expander.ThemeRole         = "SelfReferencingExpander";
            this.expander.StretchVertically = true;
            this.stackLayoutElement.Children.Add((RadElement)this.expander);
            this.BindRowProperties();
        }