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

RadGridView exception on ReorderColumn/DragColumn in PanelGroup

25 Answers 359 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rares Vasilescu
Top achievements
Rank 1
Rares Vasilescu asked on 09 Apr 2010, 09:26 AM
Hi,

I have encountered the following error when I was trying to reorder column or drag it in panel group.

assembly: Telerik.Windows.Controls.GridView.dll, version: 2010.1.326.35
ExceptionMessage:
Root AdornerLayer Not Found. Please make sure that your root visual is Window or other element that has an adorner layer. Alternatively, wrap your root panel in an <AdornerDecorator> element.

StackTrace:

   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OpenPopup()
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.StartDragging()
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.TryStartDrag(IMouseEventArgs e)
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnTrackedElementMouseMoveInternal(IMouseEventArgs e)
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnCoverRectangleMouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.MouseDevice.Synchronize()
   at System.Windows.Input.MouseDevice.ChangeMouseCapture(IInputElement mouseCapture, IMouseInputProvider providerCapture, CaptureMode captureMode, Int32 timestamp)
   at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

25 Answers, 1 is accepted

Sort by
0
Rares Vasilescu
Top achievements
Rank 1
answered on 12 Apr 2010, 10:04 AM
I have created the support ticket 298907.

Thank you.
0
Tsvyatko
Telerik team
answered on 12 Apr 2010, 11:48 AM
Hello Rares Vasilescu,

Unfortunately, we are unable to reproduce the problem based on the information sent. Can you please send additional information regarding themes, custom styles or other specifics related to the application in which the problem occurs?

Sincerely yours,
Tsvyatko
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.
0
Christopher Hujanen
Top achievements
Rank 1
answered on 27 Apr 2010, 06:02 AM
Argghh.  I just discovered I am getting this same error now after I purchased the licensed version.  I rolled back the code to use the demo version of RAD controls and it worked fine, but not using the latest version (2010.1.422.35).

How do you suggest one goes about narrowing down what the issue is?
0
Tsvyatko
Telerik team
answered on 27 Apr 2010, 11:29 AM
Hello Christopher Hujanen,

The issue we have encountered and investigated is related to applications in which the GridView is added within Page (not in Window). The core problem is related to the fact that the root visual element in Page element does not have its Adorner Layer which is essential part of the Drag and Drop mechanism.

Currently, I can suggest as workaround to add the missing Adorner Layer on Page load. It has one specific that need to kept in mind, doing it will call the Page Load Event twice. Please check the attached project as reference.

If the case in which the problem occurs does not include Page element, please sent us some additional information regarding your scenario.

Best wishes,
Tsvyatko
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.
0
Christopher Hujanen
Top achievements
Rank 1
answered on 03 May 2010, 03:09 AM
The problem I am seeing is when the gridview is on a usercontrol (or a "view" which is derived from a usercontrol).  I've attached a screenshot with also a Snoop dump of the visual tree to hopefully help you find out where the problem is.

Here is the XAML for that "usercontrol":

<my:ViewBase x:Class="MyApp.Contacts.ContactsView" 
             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:my="clr-namespace:MyApp.Common.Bases;assembly=MyApp.Common" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              
             xmlns:local="clr-namespace:MyApp.Contacts"  
             xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"  
             xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"  
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500" 
             d:DataContext="{d:DesignInstance local:ContactsDesignerViewModel, IsDesignTimeCreatable=True}"
    <Grid> 
        <telerik:RadGridView ItemsSource="{Binding Contacts}" Controls:StyleManager.Theme="Office_Blue"  
                             AutoGenerateColumns="False" CanUserFreezeColumns="False" IsReadOnly="True"  
                             ColumnWidth="*" SelectedItem="{Binding SelectedContact}" MouseDoubleClick="RadGridView_MouseDoubleClick"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Header="Group" DataMemberBinding="{Binding Company.Group.Name}" /> 
                <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding Person.FirstName}" /> 
                <telerik:GridViewDataColumn Header="Last Name" DataMemberBinding="{Binding Person.LastName}" /> 
                <telerik:GridViewDataColumn Header="Created" DataMemberBinding="{Binding CreatedOn}" /> 
 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
 
     </Grid> 
</my:ViewBase> 

0
Tsvyatko
Telerik team
answered on 05 May 2010, 11:01 AM
Hello Christopher Hujanen,

Can you also post the root elements of the visual tree? Also, could you please share with us the XAML code including custom style if there are any in order to determine the exact cause of the problem and provide solution.

Regards,
Tsvyatko
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.
0
Rieni De Rijke
Top achievements
Rank 1
answered on 10 May 2010, 08:00 AM
We have the same adorner-problems when using the grouping function.
Using the "old" version of Telerik everything was ok.
After changing to the new april-dll's this problem came up.

We also get this, when opening the xaml for the window:

System.IO.FileLoadException
Could not load file or assembly 'Telerik.Windows.Controls.GridView, Version=2010.1.422.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
...
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
0
Graham
Top achievements
Rank 1
answered on 10 May 2010, 01:26 PM
Hi Guys,
I experience the same problem with this error message.
All I have to do is rapidly click on a column header for some time and it will work the first few times doing the sorting, but eventually will crash with this error.

2010.1.422.35 Assembly Version.



//Graham.
0
Graham
Top achievements
Rank 1
answered on 10 May 2010, 01:53 PM

Ok, problem is still there.  I can trigger this problem on gridviews and also on RadScheduler.  If you attempt to drag an appointment on RadScheduler it will crash with this 'adornerlayer not found' error.

Using Latest Dev Build - 2010.1.430.35

In the last RadControls WPF for 2009 none of these problems existed.  I'm only upgrading due to some strange display bug with the height of radWindows getting cut-off in the 2009 version - that bug appears to have been fixed in the 2010 version, but more serious bugs are in the latest version it would seem. 

Does anybody have a workaround for this error?
0
Maya
Telerik team
answered on 10 May 2010, 04:17 PM
Hello Graham,

The problem occurs when there is a custom structure in your applications. The Adorner Layer is the one that provides the Drag and Drop functionality and it is not always available depending on the Root Element. 

The workaround proposed by Tsvyatko in a previous post here is applicable for almost every context. In case it does not solve the problem in yours projects, please send us a project via support ticket or post you xaml code here so that we can provide you with a better solution.
 

Regards,
Maya
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.
0
Christopher Hujanen
Top achievements
Rank 1
answered on 10 May 2010, 04:27 PM
Graham -- I also had the exact same problem with RadScheduler.  I followed the suggestion about adding an AdornerLayer but it didn't resolve the issue for me.

I will post some more details of what my visual tree looks like for analysis later today.

0
Christopher Hujanen
Top achievements
Rank 1
answered on 10 May 2010, 05:13 PM
I've attached a more complete screenshot of the visual tree using the WPF debug visualizer.  There is an AdornerLayer in there, but it looks like it's not in the right spot (highlighted).

Hope that helps!
0
Graham
Top achievements
Rank 1
answered on 11 May 2010, 01:09 AM
Hi Chris & Maya,

I have a RadGridViews in UserControls and also and experience the error.  The workaround does not work for UserControls as the solution provided by Tsvyatko is for Pages only.

I would just go back to the 2009 version, but there is an issue with the height of RadWindows on some resolutions - especially widescreen resolutions - where the bottom of the RadWindow is cropped off.  It only happens at some resolutions but unfortunately for me, that's not good enough for my client.  I am in a bit of a bind as to fix that RadWindow problem I need to upgrade to 2010, but in doing so it breaks both the Scheduler and the RadGridView with this Adorner problem.
0
Calin Calin
Top achievements
Rank 1
answered on 11 May 2010, 10:58 AM
Hi,

I am having the exact same problem. Is there a deadline on the fix, I can't use the page load approach to many places a grid gets loaded.

Thank you,
0
Alex Martinez
Top achievements
Rank 1
answered on 11 May 2010, 04:45 PM
I have the same problem within a RadScheduler inside a UserControl. I can't Drag&Drop appointments.
Anybody found a solution?
0
Christopher Hujanen
Top achievements
Rank 1
answered on 12 May 2010, 07:33 AM
The only solution I know of so far is to roll back to one of the 2009 releases.  It seems to have been broken in the 2010 release.

Maya/Tsvyatko -- Any updates on the Telerik side?  
0
Tsvyatko
Telerik team
answered on 12 May 2010, 09:09 AM
Hello Christopher Hujanen,

Currently, we are working on the solution on this issue and it will be included in one of our next internal builds. The main problem is related to the fact that when drag and drop is performed it look for adorner layer of the root panel. In structures such as custom Windows (e.g. ribbon windows), this layer might not be present and thus the drag cannot be performed. In such cases possible workaround is to inject such layer in the tree structure wrapping the top-most panel.

Please excuse us for the inconvenience caused. We will keep you posted on the progress on this issue.

Kind regards,
Tsvyatko
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.
0
Rieni De Rijke
Top achievements
Rank 1
answered on 18 May 2010, 09:37 AM
<<We will keep you posted on the progress on this issue.>>

News?
0
Tsvyatko
Telerik team
answered on 18 May 2010, 10:39 AM
Hi,

The problem regarding drag and drop that was related to the Adorner Layer has been resolved and included in the latest internal build. Please, give it a try and let us, if any further problems occur.

Please excuse us for the inconvenience caused.

Regards,
Tsvyatko
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.
0
Calin Calin
Top achievements
Rank 1
answered on 18 May 2010, 02:46 PM
Thank you for the fix, it works great !

Your product is getting better and better.
0
Alex Martinez
Top achievements
Rank 1
answered on 19 May 2010, 01:28 PM
It's correct! The build "2010.1.0515.35" works perfectly :)
0
Rieni De Rijke
Top achievements
Rank 1
answered on 20 May 2010, 02:34 PM
Thank you for the update. We are pleased with the fixes and features, but...
Selecting rows with use of the key.up and key.down only works when SelectionMode="Single".
It no longer works with SelectionMode="Extended" or SelectionMode="Multiple" like in the prior versions.
Is there a new property or something that should be set?
0
Milan
Telerik team
answered on 24 May 2010, 07:05 AM
Hello Rieni De Rijke,

The selection issues were fixed and the functionality should be back to normal with our latest build 2010.1.0521.35.

Sorry for the inconvenience.

All the best,
Milan
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.
0
Ivo
Top achievements
Rank 1
answered on 14 Aug 2010, 11:19 AM
I am reciving the same error using TreeListView control form
Telerik RadControls for WPF4  2010.2.0714
0
Yordanka
Telerik team
answered on 17 Aug 2010, 11:07 AM
Hello Ivo,

Could you please open a new forum thread under TreeListView section ? I cannot understand which of the discussed problems below you are facing with .0714 version. Thank you!

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
Tags
GridView
Asked by
Rares Vasilescu
Top achievements
Rank 1
Answers by
Rares Vasilescu
Top achievements
Rank 1
Tsvyatko
Telerik team
Christopher Hujanen
Top achievements
Rank 1
Rieni De Rijke
Top achievements
Rank 1
Graham
Top achievements
Rank 1
Maya
Telerik team
Calin Calin
Top achievements
Rank 1
Alex Martinez
Top achievements
Rank 1
Milan
Telerik team
Ivo
Top achievements
Rank 1
Yordanka
Telerik team
Share this question
or