Ejemplo n.º 1
0
        protected virtual void SetRowBindings(TreeGridRowControl rowControl)
        {
            if (this.RowType == TreeRowType.HeaderRow)
            {
                return;
            }

            if (TreeGridRowControl.SelectionBackgroundProperty.GetMetadata(typeof(FrameworkElement)).DefaultValue == rowControl.SelectionBackground)
            {
                rowControl.SelectionBackground = TreeGrid.SelectionBackground;
            }

            rowControl.IsSelected   = this.IsSelectedRow;
            rowControl.IsFocusedRow = this.IsFocusedRow;
        }
Ejemplo n.º 2
0
 protected virtual TreeGridRowControlBase OnCreateRowElement()
 {
     if (this.RowType == TreeRowType.HeaderRow)
     {
         var row = new TreeGridHeaderRowControl
         {
             Visibility = this.RowVisibility
         };
         row.DataRow = this;
         return(row);
     }
     else
     {
         var row = new TreeGridRowControl
         {
             DataContext = this.RowData,
             Visibility  = this.RowVisibility
         };
         row.DataRow = this;
         UpdateRowStyles(row);
         SetRowBindings(row);
         return(row);
     }
 }