private static RowReorderBehavior GetAttachedBehavior(RadGridView gridview)
        {
            if (!instances.ContainsKey(gridview))
            {
                instances[gridview] = new RowReorderBehavior();
                instances[gridview].AssociatedObject = gridview;
            }

            return(instances[gridview]);
        }
        public static void SetIsEnabled(DependencyObject obj, bool value)
        {
            RowReorderBehavior behavior = GetAttachedBehavior(obj as RadGridView);

            behavior.AssociatedObject = obj as RadGridView;

            if (value)
            {
                behavior.Initialize();
            }
            else
            {
                behavior.CleanUp();
            }
            obj.SetValue(IsEnabledProperty, value);
        }
 private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
 {
     isEnabled = !isEnabled;
     RowReorderBehavior.SetIsEnabled(this.radGridView, isEnabled);
 }
 public MainPage()
 {
     this.InitializeComponent();
     this.radGridView.ItemsSource = MessageViewModel.Generate();
     RowReorderBehavior.SetIsEnabled(this.radGridView, isEnabled);
 }