Drag and drop column header to create groups, not working for me.

12 posts, 0 answers
  1. David
    David avatar
    7 posts
    Member since:
    Sep 2008

    Posted 25 Jun 2012 Link to this post

    I am having a problem with the grouping functionality of the WPF Control RadGridView.   Dragging and dropping the column name to the "Drag a column header and drop it here to group by that column" area does not work.  Nothing happens, no errors.   The "IsGroupable" setting for each column is checked.  I tried explicitly setting it in the xml, and it had no effect.  The ShowGroupPanel
    on the RadGridView is set.   According to the documentation that is all that is needed.

    Here is the XAML file.




    <code>

    <UserControl x:Class="VaultSolutions.ArchiveAccelerator.ManagementConsole.JobsGridView"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 mc:Ignorable="d"
                 d:DesignHeight="300" d:DesignWidth="1313" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
                                 xmlns:my="clr-namespace:VaultSolutions.ArchiveAccelerator.ManagementConsole" Loaded="UserControl_Loaded">
        <UserControl.Resources>
            <my:vwJobsView x:Key="ThreadCollection" />
        </UserControl.Resources>

        <DockPanel Height="Auto" Name="dockPanel1" Width="Auto" AllowDrop="True">
           
            <telerik:RadGridView Name="JobsRadGridView" AutoGenerateColumns="False" Width="Auto" ItemsSource="{Binding Source=   {StaticResource ResourceKey=ThreadCollection}}" EnableRowVirtualization="True" EnableColumnVirtualization="True" AllowDrop="True" Drop="JobsRadGridView_Drop">

                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Name="ThreadIdentity" DataMemberBinding="{Binding Path=ThreadIdentity}" Header="Job #" TextAlignment="Right" />
                    <telerik:GridViewDataColumn Name="TaskName"       DataMemberBinding="{Binding Path=TaskName}" Header="Task Name"/>
                    <telerik:GridViewDataColumn Name="DTStarted"      DataMemberBinding="{Binding Path=DTStarted}" Header="DT Started"/>
                    <telerik:GridViewDataColumn Name="DTStopped"      DataMemberBinding="{Binding Path=DTStopped}" Header="DT Stopped"/>
                    <telerik:GridViewDataColumn Name="Target"         DataMemberBinding="{Binding Path=Target}" Header="Target" />
                    <telerik:GridViewDataColumn Name="SubTarget"      DataMemberBinding="{Binding Path=SubTarget}" Header="Sub Target" Width="200" />
                    <telerik:GridViewDataColumn Name="NumProcessed"   DataMemberBinding="{Binding Path=NumProcessed}" Header="# Processed" TextAlignment="Right" />
                    <telerik:GridViewDataColumn Name="NumError"       DataMemberBinding="{Binding Path=NumError}" Header="# Error" TextAlignment="Right" />
                    <telerik:GridViewDataColumn Name="EventMessage"   DataMemberBinding="{Binding Path=EventMessage}" Header="Event Message" TextWrapping="Wrap" />
                    <telerik:GridViewDataColumn Name="JobStatus"      DataMemberBinding="{Binding Path=JobStatus}" Header="Job Status"/>
                    <telerik:GridViewDataColumn Name="LastUpdate"     DataMemberBinding="{Binding Path=LastUpdate}" Header="Last Update"/>
                    <telerik:GridViewDataColumn Name="Servername"     DataMemberBinding="{Binding Path=Servername}" Header="Server Name"/>
                </telerik:RadGridView.Columns>

            </telerik:RadGridView>
          
        </DockPanel>
                     
    </UserControl>
    </code>


    The "ThreadCollection" is an ObservableCollection.

    Adding the following, displays the groups.  They are grouped correctly.  All seems to work unless you drag the group name off of the group bar, or use the close icon on the group name.  The GridView will be correct, but you can not get the group back again.

               
    <telerik:RadGridView.GroupDescriptors>
       <telerik:GroupDescriptor Member="Target" />
       <telerik:GroupDescriptor Member="JobStatus" />
       <telerik:GroupDescriptor Member="Servername" />
    </telerik:RadGridView.GroupDescriptors>

    In an attempt to debug, I added event hanlders for Grouped and Grouping events.  They never got called on the drag and drop to the group bar.  The only time they were called is when the GroupDescripitors were in place, and then only when the groups were removed from the bar. 

    Using Telerik version 12.1.326.0
    VisualStudio 2010
    .NET 3.5
    C#
    Windows Server 2003 R2

    Any suggestions would be appreciated.

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 26 Jun 2012 Link to this post

    Hello,

    I was not able to reproduce such a problem. May you please confirm whether you could reproduce the behaviour using the latest binaries - version 2012.2.607? 

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. David
    David avatar
    7 posts
    Member since:
    Sep 2008

    Posted 27 Jun 2012 Link to this post

    Yes, this problem still occurs with 2012.2.0607 binaries. 
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 Jun 2012 Link to this post

    Hello,

     I have attached the test project I created based on the code snippets you have shared. So far I was not able to reproduce the issue that you have. Please note that I have removed the "JobsRadGridView_Drop" event handler as I am not sure what additional logic you have implemented when it is raised.

    Would it be possible for you to change my test project to show the problem? That way I could advise you more properly.

    Greetings,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. David
    David avatar
    7 posts
    Member since:
    Sep 2008

    Posted 29 Jun 2012 Link to this post

    That would be difficult.  Your example does work for me.  However, when I mirrored your example in our project (I added everything from the Grid down into our UserControl), it didn't allow grouping (other than when a column is predefined in XAML with RadGridView.GroupDescriptors).  

    However, I noticed a couple differences:
    1) our project is a .NET 3.5 project, where yours uses .NET 4
    2) the Grid lies within a UserControl in ours, while it lies within a Window in yours

    Could either possibly be why this isn't working?  The weird thing is that there are no errors occurring, it's just that when I drag a column up into the "GroupPanel", the "X" icon appears (the circle with a line through it, like a Do Not Enter sign).  I tried explicitly setting IsGroupable to "true", but it doesn't make a difference.  Grouping does work in your example, just not when I mirror your example in my .NET 3.5 project.

    Thanks for your help!
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Jul 2012 Link to this post

    Hello,

     Thank you for the clarifications.

    I have changed the project to target .NET 3.5 and I have placed the GridView inside a UserControl, instead of Window. Still, I am not able to reproduce any issue dragging the column headers.

    Please find the project attached. May I ask you to check once again whether there is some additional logic performed on dragging the column header? What do you do when the JobsRadGridView_Drop event is raised? 

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. David
    David avatar
    7 posts
    Member since:
    Sep 2008

    Posted 03 Jul 2012 Link to this post

    We actually do not do anything when JobsRadGridView_Drop is raised.  I added this event handler as part of the debugging effort.  The only code in the handler was a DEBUG.Writeline.   It never appeared to get called.   It has since been removed and has had no effect.  

    Is it expected that this event is raised when a column header is dropped on the group area?   If it is, this may be a clue to the problem since I never saw the debug.writeline output.
  8. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Jul 2012 Link to this post

    Hello,

     Actually the Drop event should not be raised. So the clue is not in this event.

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. David
    David avatar
    7 posts
    Member since:
    Sep 2008

    Posted 11 Jul 2012 Link to this post

    We still have not been able to get the grouping to work in our product.   I have been able to make it work from a simple WidowsFormApplication. 

    I followed these steps:

    o Created a new windowsformsApplication.
    o Draged JobsGridView onto the form.
    o Executed the app, it worked.


    o Created a UserControl class which also implments IFormViewControl.  (This more closely resembles how we use it in our product)
    o Added JobsGridView to the new UserControl.
    o Created a new form in the WindowsFormsApplication
    o Dragged the UserControl onto the form
    o Executed the app, it worked also.

    The difference between the simple test program and our product is in the product the UserControl actualy becomes a member variable of a class that implements Microsoft.ManagementConsole.ScopeNode.  It is then used in OnRefresh logic to provide the UI we want in the MMC.  So far the RadGridView has worked great except for the lack of ability to group by dragging the column to the grouping tab zone.   

    Why would this fail when using it with the Microsoft Managment Console ?
  10. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Jul 2012 Link to this post

    Hello,

     Thank you for the additional details provided.

    We have tried to reproduce the issue as described, but so far we were not able to observe it. We would be grateful if you could isolate the problem in a demo solution which we could debug locally. Please take a look at this blog post for details on how to isolate a problem in a sample project. 

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. David
    David avatar
    1 posts
    Member since:
    Jun 2012

    Posted 12 Feb 2013 Link to this post

    We finally have been able to create a simple reproducer for this problem.   In the process we have discovered it is not just the grouping that is failing, but drag and drop in general.  Trying to change the order of the columns does not work either.   I created 2 controls to test using in the MMC.  Both are simple Windows Forms User controls which contain a grid.  One grid is a Telerik RadGridView and the other is a WPFToolkit DataGrid.   If I create a MMC Snapin using the Telerik RadGridView I can not drag and drop the columns.  If I create a MMC Snapin using the WPFToolkit DataGrid, I can drag and drop the columns.

    During our debugging process we observed that it appears the Telerik RadGridView drag event handlers do not get called when used in the MMC snappin.  Using the same control from a simple Windows Form Application the event handlers do get called. 

    I have a simple reproducer available if someone at Telerik is willing to take a look at it.
  12. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Feb 2013 Link to this post

    Hello,

     Please open support ticket and send us your example. 

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top