A project I'm working on for a client, that uses Telerik WPF controls gives errors in VS 2015 XAML Designer.
The project builds though, but the designer is not able to render the XAML, and this is important at this particular occasion.
For this XAML code produces the error: Assembly 'Telerik.Windows.Themes.Green' is not referenced by this project
<Application
x:Class="nspace.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/System.Windows.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Chart.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Input.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
</ResourceDictionary>
</Application.Resources>
</Application>
And everywhere through the project where some control is used, for example : "<telerik:Label" produces " "The name "Label" does not exist in the namespace"http://schemas.telerik.com/2008/xaml/presentation".
Also looks like this is an issue only under VisualStudio 2015. I have tried cleaning the solution, rebuilding, changing to debug/release, adding attribute and manually deleting the shadow cache of visual studio but to no avail.
I will greatly appreciate your help. Thank you.
So, I have a RadListBox that I have set up to reorder items when the user drags one list box item in between two others. Its xaml looks a little something like this:
<tk:RadListBox Width="150" MaxHeight="700" VerticalAlignment="Top" VerticalContentAlignment="Top" tk:DragDropManager.AllowCapturedDrag="True" tk:DragDropManager.AllowDrag="True" AllowDrop="True" Background="Transparent" ItemContainerStyle="{StaticResource AttachmentDragItemStyle}" ItemTemplateSelector="{StaticResource ThumbnailTemplateSelector}" ItemsSource="{Binding Attachments}" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectedItem="{Binding SelectedAttachment, Mode=TwoWay}"> <tk:RadListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" /> </ItemsPanelTemplate> </tk:RadListBox.ItemsPanel> <tk:RadListBox.DragDropBehavior> <behaviors:ListBoxDragDropBehaviorEx /> </tk:RadListBox.DragDropBehavior> <tk:RadListBox.DragVisualProvider> <tk:ScreenshotDragVisualProvider /> </tk:RadListBox.DragVisualProvider> <tk:RadListBox.DropVisualProvider> <tk:LinearDropVisualProvider /> </tk:RadListBox.DropVisualProvider></tk:RadListBox>
with the extended drag drop behavior being:
public class ListBoxDragDropBehaviorEx : ListBoxDragDropBehavior{ public override void DragDropCanceled(DragDropState state) { //base.DragDropCanceled(state); } protected override IEnumerable<object> CopyDraggedItems(DragDropState state) { //return base.CopyDraggedItems(state); return new List<object>(); } public override void Drop(DragDropState state) {//implement some custom logic here //Do not call -> base.Drop(state); try { if (state.IsSameControl) { if (state.InsertIndex < 0) return; if (state.DraggedItems != null) { foreach (var item in state.DraggedItems) { BaseEntity obj = item as BaseEntity; if (obj == null) continue; var index = state.SourceItemsSource.IndexOf(obj); if (index >= 0) { state.SourceItemsSource.Remove(obj); state.SourceItemsSource.Insert(state.InsertIndex, obj); } } } } } catch (Exception e) { MessageBoxUtil.ShowMessageBox("Drag & Drop error occurred", "Unable to reorder"); } } public override void DragDropCompleted(DragDropState state) { try { base.DragDropCompleted(state); } catch (Exception e) { MessageBoxUtil.ShowMessageBox("Drag & Drop error occurred", "Unable to reorder"); } }}
Now, this works beautifully... when it doesn't crash. But occasionally, if the user decides to perform a crazy mouse seizure and too many drag and drops are issued too quickly, a nullreference exception will be thrown with this stack trace:
at Telerik.Windows.Controls.RadListBoxDragDropHelper.Drop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, Object data, Type itemType)
at Telerik.Windows.DragDrop.Behaviors.DragDropHelper`2.Drop(Object sender, DragEventArgs e)
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 Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnDragEventHandler(Object sender, DragEventArgs e)
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.OleDropTarget.RaiseDragEvent(RoutedEvent dragEvent, Int32 dragDropKeyStates, Int32& effects, DependencyObject target, Point targetPoint)
at System.Windows.OleDropTarget.MS.Win32.UnsafeNativeMethods.IOleDropTarget.OleDrop(Object data, Int32 dragDropKeyStates, Int64 point, Int32& effects)
at MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
at System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
at System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects)
at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
at Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects, DragDropKeyStates initialKeyState, Object dragVisual, Point relativeStartPoint, Point dragVisualOffset)
at Telerik.Windows.DragDrop.DragInitializer.StartDrag()
at Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
at Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(Object sender, MouseEventArgs e)
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.RaiseTrustedEvent(RoutedEventArgs args)
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.Capture(IInputElement element, CaptureMode captureMode)
at Telerik.Windows.DragDrop.DragInitializer.DragSourceMouseLeave(Object sender, MouseEventArgs e)
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.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, 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, WindowMessage 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, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
^ This is the point where the window opens, so obviously there is no code between here and the crash that I have control of. I am wondering why this happens sometimes and what can be done to fix this? I see no way to prevent this crash as it all seems to be happening inside telerik code. Please advise.
Hi,
The requirement is converting HTML string into RadDocument xaml string, so I take the docs from
https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/formats-and-conversion/html/htmlformatprovider#export
and wrote the code as follow:
HtmlFormatProvider provider = new HtmlFormatProvider();
XamlFormatProvider provider2 = new XamlFormatProvider();
RadDocument document = provider.Import(html);
string xaml = provider2.Export(document);
return xaml;
the error pops in line 3:
"The type initializer for 'Telerik.Windows.Documents.UI.TextDecorations.DecorationProviders.UnderlineTypes' threw an exception."
How to solve this?
Thanks,
Rain

I have a simple RadWindow modal dialog that contains nothing but a RadWizard. On the CompletionWizardPage, I have the finish button text set to a localized string.
The caller adds an event handler to the Completed event and then calls ShowDialog().
If I double-click "Finish" really fast on the dialog, my Completed handler does indeed get called twice. That is not good eats. (Granted, any sane user would not double-click a button, but my tester's sanity is in question.)
I'm using UI for WPF 2017.3.1018.45 on 64 bit Win 10 and VS 2015.
Seems that a debounce is in order for that button.
-reilly.


Hi everyone,
I am currently creating a control syncing a RadScheduleView with RadTimeBar and RadCalendar.
The controls are pretty great, and everthing works so far, but I have one problem on the UI itself :
The RadCalendar is using a DayTemplateSelector to mark days corresponding to appointements in the RadScheduleView, and when these appointements are being edited, I use
calendar.OnApplyTemplate()
The data itself is ok, but each time some sort of Zoom/Popup effect is used on the RadCalendar : See the attached capture to see what I mean.
I just want to disable this animation, but wasn't able to find it on the defaut template.
Could you help me?
(I know I could use something like
DataTemplateSelector dts = calendar.DayTemplateSelector;calendar.DayTemplateSelector = null;calendar.DayTemplateSelector = dts;instead, wich resolve that issue, but also freeze the control for half a second each time, annoying)
Thanks a lot!

I have a datagrid with pagination and filters in the columns. When I apply a filter I show a progress bar, I show it in the OnFiltering event and hide it in OnFiltered. After the OnFiltered event the datagrid takes about 2 seconds to update the rows. Is there any way to hide the progress bar after that the datagrid finish updating? I have not found any event that serves me. I have tried with the gridview.Items.CurrentChanged event but it triggers before the datagrid has been updated.
Is there any way to detect that the datagrid has finished filtering the items?
Regards,
Gerard.
I've been searching around but what I've found so far has been inconclusive and unsatisfactory. I would like an interface similar to the print preview that exists for the spreadsheet but there doesn't seem to be anything.

I've modified the GridViewRowTemplate in order to change the colors of a row when it's selected. But by doing so, I'm unable to use a RowStyleSelector. Anyone have any tips as to how I can keep the functionality of a RowStyleSelector in play while modifying the background color of a selected row? (The background color of a selected row in the Office 2016 template is far too light.)