private static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { var grid = dependencyObject as RadGridView; if (grid != null) { var clipboardBehavior = new GridViewClipboardCustomBehavior(grid); if ((bool)e.NewValue) { clipboardBehavior.Attach(); } else { clipboardBehavior.Detach(); } } }