Telerik Forums
UI for WPF Forum
3 answers
86 views

Hello,

The application I am working on is throwing the following unhandled exception whenever I attempt to identify a TabControl WPF object using my automation tool. This issue started occurring when we upgraded our Telerik libraries from Library v2012.3.1129.40 to v2012.1.326.402. We are using HP QTP to automate our testing.

When I try to access the TabControl I get the following unhandled exception:

System.Reflection.TargetInvocationException was unhandled
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at PM.Live.Client.App.Main() in C:\pl\Source\PM\PM.Live.Client\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.MissingMethodException
       Message=Method 'PM.Live.Client.Common.Controls.TertiaryTabControl.Item' not found.
       Source=mscorlib
       StackTrace:
            at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
            at Mercury.WpfAgent.DispWrapper.DispThreadInvoke(String name, BindingFlags invokeAttr, Binder binder, Object obj, Object[] UnWrappedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
       InnerException:

I have had a similar issue with an Telerik.Windows.Automation.Peers.GridViewGroupPanelAutomationPeer.GetChildrenCore()  which was resolved in internal build version 2012.3.1314. Is this too related to the Automation class change from the last quarterly build? Will there be a fix provided for this issue as well?

 

Regards,

Mike

Dinko | Tech Support Engineer
Telerik team
 answered on 27 Jan 2021
2 answers
257 views

Hi,

I've created a ChartView with a label bindind based on the code that I've found here https://www.telerik.com/forums/categoricalaxis-set-the-label-from-a-datapoint-dataitem.

 

My problem is that I'm not able to have the label updated when I change the set of data. The graphic is correctly updated but not the label.
I suspect an issue around the Attached Propery but I'm not able to find where is my issue. Is a way to force the update of the AxisLabel ?

Here is the code that I've changed in the code found in the previous link.

Thanks for your help.

<Window x:Class="Label_Binding.MainWindow"
        xmlns:local="clr-namespace:Label_Binding"
        mc:Ignorable="d"
        Title="MainWindow" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>
        <telerik:RadCartesianChart Grid.Row="0">
             
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis >
                    <telerik:CategoricalAxis.LabelTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <telerik:Label local:ChartUtilities.AxisLabelContent="{Binding}"  />
                            </StackPanel>
                        </DataTemplate>
                    </telerik:CategoricalAxis.LabelTemplate>
                </telerik:CategoricalAxis>
            </telerik:RadCartesianChart.HorizontalAxis>
             
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Minimum="0" Maximum="100" MajorStep="20" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:BarSeries CategoryBinding="Category" ValueBinding="Level" ItemsSource="{Binding FilteredData}" CombineMode="Stack">
                    <telerik:BarSeries.PointTemplate>
                        <DataTemplate>
                            <Rectangle Fill="{Binding DataItem.FillColor}"/>
                        </DataTemplate>
                    </telerik:BarSeries.PointTemplate>
                </telerik:BarSeries>
                <!--<telerik:StepLineSeries CategoryBinding="Category" ValueBinding="MaxLevel" ItemsSource="{Binding OctaveData}" ShowLabels="True" Stroke="DarkGray" />-->
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>
        <telerik:RadButton Grid.Row="1" Content="Change Source" Click="RadButton_Click"/>
    </Grid>
</Window>

 

using System.Windows;
 
namespace Label_Binding
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        ViewModel vm;
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = vm = new ViewModel();
        }
 
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            vm.ChangeData();
        }
    }
}

 

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows.Media;
 
namespace Label_Binding
{
    public class ViewModel : INotifyPropertyChanged
    {
        public ObservableCollection<ChartData> Data { get; set; }
        public IEnumerable<ChartData> FilteredData { get; set; }
 
        Random rnd = new Random();
        private Boolean isChanged;
 
        public event PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
 
        public ViewModel()
        {
            Data = new ObservableCollection<ChartData>();
            GetData();
            isChanged = false;
            FilteredData = Data.Where(n => n.Index < 5);
        }
 
        public void ChangeData()
        {
            if (!isChanged)
            {
                FilteredData = Data.Where(n => n.Index >= 5);
            }
            else
            {
                FilteredData = Data.Where(n => n.Index < 5);
            }
            isChanged = !isChanged;           
            RaisePropertyChanged("FilteredData");
        }
 
        private void GetData()
        {
            for (int i = 0; i < 5; i++)
            {
                ChartData point = new ChartData();
                point.Index = i;
                point.Category = "Cat "+i;
                point.Average = rnd.Next(10,60);
                point.Level = rnd.Next(10,60);
                point.FillColor = new SolidColorBrush(Colors.Bisque);         
                Data.Add(point);
            }
            for (int i = 0; i < 5; i++)
            {
                ChartData point = new ChartData();
                point.Index = i + 5;
                point.Category = "Cat " + i;
                point.Average = rnd.Next(10, 60);
                point.Level = rnd.Next(10, 60);
                point.FillColor = new SolidColorBrush(Colors.Bisque);
                Data.Add(point);
            }
        }
    }
}

 

 

Guillaume
Top achievements
Rank 1
 answered on 27 Jan 2021
1 answer
256 views

Is there a way to extract active theme settings from the StyleManager?

Cheers, Rob.

Dilyan Traykov
Telerik team
 answered on 27 Jan 2021
2 answers
267 views
I am trying to change the selected tab's background color.  I've managed to do this the following code, but when i run the project, I can't select any tabs at all.  Nothing happens when I click a tab.

<Window.Resources>
    <Style TargetType="{x:Type telerik:RadTabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadTabItem}">
                    <Grid >
                        <Border
                             Name="Border"
                             Background="LightBlue"
                             BorderBrush="Black"
                             BorderThickness="1,1,1,1"
                             CornerRadius="6,6,0,0" >
                            <ContentPresenter x:Name="ContentSite"  Margin="12,2,12,2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="LightBlue" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="LightGray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>
Richard
Top achievements
Rank 2
Veteran
 answered on 27 Jan 2021
6 answers
312 views

Hello

Do I get it right, that when I receive following exception, that means that somewhere my ```INotifyDataErrorInfo.GetErrors``` returns null instead of empty list?

```

System.ArgumentNullException: Value cannot be null.
Parameter name: collection
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Telerik.Windows.Controls.GridViewBoundColumnBase.GetDataErrorValidationErrors(Object dataItem, String propertyName, GridViewValidationType gridViewValidationType)
   at Telerik.Windows.Controls.GridViewBoundColumnBase.GetValidationErrors(Object dataItem, String propertyName)
   at Telerik.Windows.Controls.GridView.GridViewCell.GetDataErrors()
   at Telerik.Windows.Controls.GridView.GridViewCell.UpdateIsValidState()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.DataErrorsChangedEventArgs>.ReceiveWeakEvent(Object sender, DataErrorsChangedEventArgs args)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   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)

```

Vladimir Stoyanov
Telerik team
 answered on 27 Jan 2021
2 answers
252 views

Hi

I'm attempting to set the TextAlignment property of a GridViewExpressionColumn at runtime. The property is set correctly but the change is not reflected in the grid. The same change to a GridViewDataColumn works as I would expect - the alignment is set visually on the screen straight away.

var col = this.RadGridView.Columns[0];
col.TextAlignment = TextAlignment.Right;

 

I have found that it the column is removed and re-inserted it will work correctly:

var col = this.RadGridView.Columns[0];
 
this.RadGridView.Columns.Remove(col);
 
col.TextAlignment = TextAlignment.Right;
 
this.RadGridView.Columns.Insert(0, col);

 

 

Is this a bug? Or am I missing something?

 

Regards

 

Dave

 

 

David
Top achievements
Rank 1
Veteran
 answered on 26 Jan 2021
1 answer
1.8K+ views

Hello:

We have several SVG icons designed by company, but we cannot find a way to use them on Robbon buttons, 

Is there any solution that we can use .svg for button icon?

Thanks!

 

Martin Ivanov
Telerik team
 answered on 26 Jan 2021
1 answer
174 views

I'm getting a strange pause during the animation of a callout?  See code below:

 

Private Sub imHelpEnhanceDistance_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles imHelpEnhanceDistance.MouseDown
 
        Try
            Dim clCodeCallout As New RadCallout()
            With clCodeCallout
                .FontSize = 10
                .Content = "My helpful Text Message"
                .Width = 210
                .Height = 70
                .TextWrapping = TextWrapping.Wrap
                .Background = Brushes.DarkGreen
                .Foreground = Brushes.White
            End With
 
            Dim clSettings As New CalloutPopupSettings()
            With clSettings
                .Placement = System.Windows.Controls.Primitives.PlacementMode.Top
                .CanPopupExceedScreen = True
                .ShowAnimationDuration = 0.55D
                .ShowAnimationEasing = New BounceEase() With {.EasingMode = EasingMode.EaseOut, .Bounces = 20, .Bounciness = 5}
                .CloseAnimationEasing = New CircleEase() With {.EasingMode = EasingMode.EaseOut}
                .CloseAnimationDuration = 0.3D
                .ShowAnimationType = CalloutAnimation.Move
                .CloseAnimationType = CalloutAnimation.Move
                .AutoClose = True
            End With
 
            CalloutPopupService.Show(clCodeCallout, TryCast(sender, FrameworkElement), clSettings)
 
        Catch ex As Exception
 
            Log.Write(ex)
 
        End Try
 
    End Sub
Martin Ivanov
Telerik team
 answered on 21 Jan 2021
10 answers
283 views

Hi

I am wondering if it is possible to use the clustering features available in RadMap to be able to group moving map markers?

For example 1) Two vehicles driving next to each other along a road show as a moving cluster

For example 2) Two vehicles driving towards each other on a road, cluster when close to each other, then separate when they have passed each other

 

In both examples, can the cluster(s) be recalculated when marker locations change so that the cluster marker moves / de-clusters as appropriate?

 

I understand that the clustering features work great with static markers (like in the 'airports' example) and I understand that clusters can be regenerated on a map zoom but I cannot see a way to regenerate, move and possibly break-up a cluster on a marker location change.

 

Am I missing something obvious?

 

Thanks

 

 

Martin Ivanov
Telerik team
 answered on 21 Jan 2021
1 answer
128 views

Hello,

This already appears with previous release and is still visible with the current one: it seems that the stylesheet is missing as no formatting is applied to the text...

Dilyan Traykov
Telerik team
 answered on 21 Jan 2021
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?