Drag from Gridview

6 posts, 1 answers
  1. Michael Storchmann
    Michael Storchmann avatar
    15 posts
    Member since:
    Nov 2009

    Posted 19 Apr 2011 Link to this post

    Hi Guys,

    reffering to your WPF-Demo "Tree to Grid Drag": How can I prevent
    a Drag-Operation from the GridView by dragging the Header instead of
    the item?

    The behavior makes no sense. In your corresponding Silverlight-Example
    you can´t drag the Header.

    Bye, Michael
  2. Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 19 Apr 2011 Link to this post

    Hello Michael Storchmann,

    To prevent dragging of the header cells, you need to disable grouping of the grid on column level by setting IsGroupable to False. 
     
    Kind regards,
    Yordanka
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael Storchmann
    Michael Storchmann avatar
    15 posts
    Member since:
    Nov 2009

    Posted 19 Apr 2011 Link to this post

    Hello Yordanka,

    sorry, but that is too simple :-) It doesn´t work (Q1/2011, no internal Build).
    Look at your WPF-Demo "Tree to Grid Drag", change the RadGridView (x:Name="orderView")
    from AutogenerateColumns="True" to "False".

    Add:
       <telerik:RadGridView.Columns>
           <telerik:GridViewDataColumn IsGroupable="False" DataMemberBinding="{Binding Name}"  Header="Name"  />
           <telerik:GridViewDataColumn IsGroupable="False" DataMemberBinding="{Binding Description}" Header="Description" />
        </telerik:RadGridView.Columns>
    After start the Demo drag e.g. the "Name" ColumnHeader to the TreeView.
    It works - but it shouldn´t.




    Michael
  5. Michael Storchmann
    Michael Storchmann avatar
    15 posts
    Member since:
    Nov 2009

    Posted 21 Apr 2011 Link to this post

    Any help? SP1 has the same (ok, small but confusing) problem.

    Michael
  6. Answer
    Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 21 Apr 2011 Link to this post

    Hi Michael Storchmann,

    Excuse me for the misunderstanding.

    We have investigated why the WPF demo header cells can be dragged and it seems that we have missed to exclude GridViewHeaderCell element from the DragAndDrop implementation. This should be done on each DragAndDrop event - OnDragInfo, OnDropInfo, OnDragQuery, OnDropQuery:

    if (e.Options.Source is GridViewHeaderCell)
               {
                   return;
               }

    You can check the corresponding Silverlight demo for a reference. 
     
    Best wishes,
    Yordanka
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Michael Storchmann
    Michael Storchmann avatar
    15 posts
    Member since:
    Nov 2009

    Posted 22 Apr 2011 Link to this post

    Hello Yordanka,

    ok, I understand - and I´ve made the changes. There is a small issue:
    if I select the Header, the Drag-Operation seems to start. But it isn´t
    the Drag-Operation, it is the "IsGroupable"-Operation. It seems the current
    version of the GridView doesn´t respect the "IsGroupable=False"-Property.
    But for that, it is the wrong forum.

    Thanks, Michael
Back to Top
UI for WPF is Visual Studio 2017 Ready