This is a migrated thread and some comments may be shown as answers.

reorderbehavior and extended selection

3 Answers 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Veteran
David Ocasio asked on 19 Nov 2010, 09:22 PM
I took the row reordering behavior class you guys wrote from your demo (gridview row redordering)) and i am actually using it to move rows from one grid to another. In doing so i came accross some aberent behavior. I simplified what  i was doing by only using one grid and the behavior still exists.

specifically If:
  • the grid is set to extended selection
  • drag and drop a row from the near the top to near the bottom
  • quickly move the mouse after the drop

a number of rows become selected even though you have released the left hand mouse button.
in fact the grid thinks the mouse button is still down and as you move the mouse up and down selects and unselects

I am incuding a sample page i made to demonstrate as well as snapshots of the behavior.
I can send the test project if you need.
 
i used

  • BeginingDragEventArgs.vb
  • DragStartedEventArgs.vb
  • RowReorderBehavior.stylingproperties.vb
  • RowReorderBehavior.vb

from the demo

<UserControl x:Class="agTestBed3.MainPage"
               
   xmlns:dragAndDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
  
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
  <Grid x:Name="LayoutRoot" >
        <telerik:RadGridView  Name="RadGridView1" SelectionMode="Extended" dragAndDrop:RadDragAndDropManager.AllowDrop="True" />
    </Grid>
</UserControl>

Imports System.Windows.Data
Imports Telerik.Windows.Controls
Imports Telerik.Windows.Data
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports System.Runtime.CompilerServices
  
Partial Public Class MainPage
    Inherits UserControl
  
    Public collStates As New ObservableCollection(Of State)
  
    Public Sub New()
        InitializeComponent()
  
        collStates.Add(New State With {.IDState = "0", .NameState = "FL"})
        collStates.Add(New State With {.IDState = "1", .NameState = "GA"})
        collStates.Add(New State With {.IDState = "2", .NameState = "aa"})
        collStates.Add(New State With {.IDState = "3", .NameState = "bb"})
        collStates.Add(New State With {.IDState = "4", .NameState = "cc"})
        collStates.Add(New State With {.IDState = "5", .NameState = "dd"})
        collStates.Add(New State With {.IDState = "6", .NameState = "ee"})
        collStates.Add(New State With {.IDState = "7", .NameState = "ff"})
  
        RowReorderBehavior.SetIsEnabled(RadGridView1, True)
  
        RadGridView1.ItemsSource = collStates
    End Sub
  
End Class
  
Public Class State
    Implements INotifyPropertyChanged
  
    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
    Private Sub FirePropertyChanged(ByVal [property] As String)
        If Not String.IsNullOrEmpty([property]) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs([property]))
        End If
    End Sub
  
    Public Property IDState() As String
        Get
            Return _IDState
        End Get
        Set(ByVal value As String)
            _IDState = value
            FirePropertyChanged("IDState")
        End Set
    End Property
    Protected _IDState As String
  
    Public Property NameState() As String
        Get
            Return _NameState
        End Get
        Set(ByVal value As String)
            _NameState = value
            FirePropertyChanged("NameState")
        End Set
    End Property
    Protected _NameState As String
  
End Class

3 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 25 Nov 2010, 08:29 AM
Hello David Ocasio,

In order to avoid such undesired behavior I can suggest set DragElementAction="None" on DragStarted and on DragEnded DragElementAction="Select".

Let me know if experience any other issues regarding this scenario

Kind regards,
Tsvyatko
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
David Ocasio
Top achievements
Rank 2
Veteran
answered on 29 Nov 2010, 04:03 AM
Thanks Tsvyatko ,

Simply putting
DragElementAction="None" on the grid xaml itself in fact did work.

Can you explain to me what is occuring.
Is it expected behavior or just a aberration

thanks
dco
0
Tsvyatko
Telerik team
answered on 01 Dec 2010, 05:32 PM
Hello David Ocasio,

We have considered this behavior as an issue and I have logged it in our PITS system - http://www.telerik.com/support/pits.aspx#/public/silverlight/4205.

I have also updated you telerik point for reporting it.

Greetings,
Tsvyatko
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
David Ocasio
Top achievements
Rank 2
Veteran
Answers by
Tsvyatko
Telerik team
David Ocasio
Top achievements
Rank 2
Veteran
Share this question
or