Welcome to the Xceed Community | Help
Community Search  
More Search Options

Row selection causes PrepareDrag operation

Sort Posts: Previous Next
  •  12-14-2010, 5:22 AM Post no. 29461

    Row selection causes PrepareDrag operation

    Hi,
     
    Iv'e set up a demo app using the XCeed 3.8 trial version and Iv'e run into the following problem: If you manually set the columns for the datagrid and you
    set the grid's AllowDrag = "True", the grid tries to initialize a drag operation each time that you click on any row. I load 2000 dummy items into the grid, then click on the first item, hold in shift, scroll down and click on the last item to select all of the items in the grid. Because the grid tries to initialize a drag operation it takes several seconds for the selection to complete.
     
    Note: Iv'e tested this without manually specifying the columns and then the selection does not cause a drag operation to be initialized. Iv'e also tested it with the manually specified columns and the AllowDrag property set to false and then the selection also does not cause any delay, obviously because the grid does not try to initialize a drag operation.
     
    Here is the code for my demo app:
     
    XAML: 
     
    <Window x:Class="XceedDemo.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:xceed="http://schemas.xceed.com/wpf/xaml/datagrid"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <xceed:DataGridControl MinWidth="447" Name="MainGrid" Grid.Row="1" HorizontalAlignment="Stretch" AutoCreateColumns="False" AllowDrag="True">
                <xceed:DataGridControl.Columns>
                    <xceed:Column FieldName="a" Title="a"/>
                    <xceed:Column FieldName="b" Title="b"/>
                    <xceed:Column FieldName="c" Title="c"/>
                    <xceed:Column FieldName="d" Title="d"/>
                    <xceed:Column FieldName="e" Title="e"/>
                    <xceed:Column FieldName="f" Title="f"/>
                    <xceed:Column FieldName="g" Title="g"/>          
                </xceed:DataGridControl.Columns>
            </xceed:DataGridControl>
        </Grid>
    </Window>
     
    Code Behind:
     
    namespace XceedDemo
    {

        public class A
        {
            private string _a;

            public string a 
            {
                get 
                {
                    System.Diagnostics.Debug.WriteLine("a");
                    return _a; 
                }
                set { _a = value; }
            }
            public string b { get; set; }
            public string c { get; set; }
            public string d { get; set; }
            public string e { get; set; }
            public string f { get; set; }
            public string g { get; set; }
        }

        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();

                ObservableCollection<A> items = new ObservableCollection<A>(this.GetEnumerableWithData(2000));
                DataGridCollectionView collectionView = new DataGridCollectionView(items);
                this.MainGrid.ItemsSource = collectionView;
            }

            private IEnumerable<A> GetEnumerableWithData(int size)
            {
                for(int i = 0; i < size; i++)
                {
                    yield return new A() { a = Guid.NewGuid().ToString(), b = Guid.NewGuid().ToString(), c = Guid.NewGuid().ToString(), d = Guid.NewGuid().ToString(), e = Guid.NewGuid().ToString(), f = Guid.NewGuid().ToString(),
                                           g = Guid.NewGuid().ToString() };
                }
            }
        }
     
    If I put a breakpoint in any of my class A's properties and iv'e got "Show External Code" in the Visual Studio Call Stack selected we can see the call to prepare the DragDataObject if you click on any row in the grid:
    Xceed.Wpf.DataGrid.dll!Xceed.Wpf.DataGrid.DataGridControl.PrepareDragDataObject(System.Windows.Input.MouseEventArgs e = {System.Windows.Input.MouseButtonEventArgs}) + 0x7d bytes
     
    For us to use the Xceed DataGrid in our products we need to be able to do drag operations while using custom columns (so that we can create data templates for the different properties in our data collections). Is there any fix or workaround for the problem?
     
    Regards,
     
    Imri Lubbe 
  •  12-14-2010, 4:22 PM Post no. 29470 in reply to 29461

    Re: Row selection causes PrepareDrag operation

    Hi Imri,

    We were able to reproduce the behavior you describe. Thank you for bringing this to our attention.

    A fix request has been submitted to the development team to investigate the issue further. We will post an update when a fix becomes available for download. Thank you for your patience.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  12-15-2010, 1:11 AM Post no. 29472 in reply to 29470

    Re: Row selection causes PrepareDrag operation

    Thanks for the quick response Diane. We will be waiting for the update with anticipation.

     

    Regards,

    Imri Lubbe 

  •  05-22-2012, 4:26 PM Post no. 32139 in reply to 29472

    Re: Row selection causes PrepareDrag operation

    Hi Imri,

    This is to inform you that this issue is now fixed in the latest version, which you can download in our Updates section here:
    http://xceed.com/updates


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.