Telerik Forums
UI for WPF Forum
3 answers
373 views
Hello,
I'm evaluating RadControls for WPF.
My program need many custom shapes like visio stencil.

I want to convert vector images into custom shapes for diagram.

What I did is as follows.

1. Convert sample wmf file into xaml file with MS Expression Design 4
    Export-Format as XAML WPF Canvas

2. I refered CustomShapeExample and inserted xaml code in Generic.xaml by MSED4 for my own custom shape.
<Style TargetType="local:MyFirstShape">
        <Setter Property="BorderThickness" Value="4" />
        <Setter Property="BorderBrush" Value="#6C666666" />
        <Setter Property="Width" Value="350" />
        <Setter Property="Height" Value="300" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Margin" Value="0" />


        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MyFirstShape">
                    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Document" Width="190.904" Height="179.643" Clip="F1 M 0,0L 190.904,0L 190.904,179.643L 0,179.643L 0,0">
                        <Canvas x:Name="MC900295085" Width="799.598" Height="599.808" Canvas.Left="0" Canvas.Top="0">
                            <Path x:Name="Path" Width="92.3327" Height="66.4918" Canvas.Left="98.5714" Canvas.Top="98.588" Stretch="Fill" Fill="#ED000000" Data="M 190.904,159.906L 190.232,160.002L ..... 190.904,159.906 Z "/>
...
...
...
                        </Canvas>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

3. Then I could load it's image in a diagram, but it didn't resize.

Question.
We need to make custom shapes with vector image. Could you tell me the best way for this?

Regards,

Pavel R. Pavlov
Telerik team
 answered on 18 Mar 2013
3 answers
176 views
If the ChartPanAndZoomBehavior is changed after the chart has been constructed then the Pan and Zoom bars on the chart are not updated to reflect the new behavior.

For example, the chart is constructed with a pan and zoom behavior set to allow both panning and zooming. Later, based on user interaction, the original pan and zoom behavior is removed and a new pan and zoom behavior that only allows panning is added. The user can no longer use the mouse to draw a rectangle to zoom the chart but the pan and zoom bars still have handles that let the user zoom.

Is there a way to get the pan and zoom bars to update to match the pan and zoom behavior?

Terry
Petar Kirov
Telerik team
 answered on 18 Mar 2013
5 answers
155 views
I have a Radgrid where if i group by certain columns and then edit some rows data. It will automatically shift that row to the group that it should belong to. Is there any way i can stop this behavior.
Vera
Telerik team
 answered on 18 Mar 2013
1 answer
139 views
hi,

is it possible to use the RadContextMenue in a Outlook 2010 Mailbody ContextMeneu?

Thanks
best Regards
Rene
Rosen Vladimirov
Telerik team
 answered on 18 Mar 2013
12 answers
1.0K+ views
Hi,
I am getting this error when debugging my application:- System.Windows.Markup.XamlParseException: 'Initialization of 'Telerik.Windows.Controls.RadPropertyGrid' threw an exception.' Line number '8' and line position '34'. ---> System.Xaml.XamlObjectWriterException: Set property 'System.Windows.ResourceDictionary.Source' threw an exception. ---> System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception. ---> System.Xaml.XamlObjectWriterException: Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.Windows.Controls.Input, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified. ...

This only happens when the RadPropertyGrid is the first and only Telerik control that is displayed/loaded.

I have another form that contains a RadComboBox and a RadGridView. If I display that first, close it then load the form with the RadPropertyGrid, the error does not occur.

So, I added a RadComboBox before the RadPropertyGrid in the XAML and the error goes away.

My application .Net 4, WPF, C# and is structured in MVVM style so the XAML code-behind is the default. However, the host application insists the WPF view (WPF user control) be presented in a Windows Forms user control so the container hierarchy is Windows Forms user control > element host > WPF user control.

I'm trialling RadControls for WPF 2012.3.1129.40.

Please can you suggest what I should check?
Thanks
Craig

Kunal Chowdhury
Top achievements
Rank 2
 answered on 18 Mar 2013
5 answers
169 views
Title says it all: is the RadChart supposed to support anonymous types?

I was test driving some of the Telerik controls and kept getting the exception at the end of this post. This exception was captured both by the Visual Studio designer and at runtime. As soon as I replaced the anonymous type with a nested class the exception went away.





System.TypeAccessException was unhandled
  Message=Attempt by method 'DynamicClass.Telerik_DynamicGetter_Distance(System.Object)' to access type '<>f__AnonymousType0`4<System.Double,System.Double,System.Double,System.Double>' failed.
  Source=Anonymously Hosted DynamicMethods Assembly
  TypeName=""
  StackTrace:
       at Telerik_DynamicGetter_Distance(Object )
       at Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding.GetValue(Object instance) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\PropertyNameDataPointBinding.cs:line 97
       at Telerik.Windows.Controls.ChartView.ScatterSeriesDataSource.InitializeBinding(DataPointBindingEntry binding) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ScatterSeriesDataSource.cs:line 114
       at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.GenerateDataPoint(Object dataItem, Int32 index) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line 145
       at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.BindCore() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line 104
       at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Bind() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line 234
       at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Rebind(Boolean itemsSourceChanged, IEnumerable newSource) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line 80
       at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.set_ItemsSource(IEnumerable value) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line 53
       at Telerik.Windows.Controls.ChartView.ChartSeries.InitDataBinding() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.cs:line 309
       at Telerik.Windows.Controls.ChartView.ScatterPointSeries.InitDataBinding() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Series\Scatter\ScatterPointSeries.cs:line 152
       at Telerik.Windows.Controls.ChartView.ChartSeries.OnApplyTemplate() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.cs:line 238
       at Telerik.Windows.Controls.ChartView.PointTemplateSeries.OnApplyTemplate() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\PointTemplateSeries.cs:line 164
       at Telerik.Windows.Controls.ChartView.ScatterLineSeries.OnApplyTemplate() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Series\Scatter\ScatterLineSeries.cs:line 140
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.UIElement.UpdateLayout()
       at System.Windows.Controls.TabItem.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
       at System.Windows.UIElement.OnPreviewGotKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
       at System.Windows.Input.KeyboardFocusChangedEventArgs.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.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(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.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
       at System.Windows.Input.Keyboard.Focus(IInputElement element)
       at System.Windows.UIElement.Focus()
       at System.Windows.Controls.TabItem.SetFocus()
       at System.Windows.Controls.TabItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.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.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.EventRoute.ReInvokeHandlers(Object source, RoutedEventArgs args)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.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.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(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.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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       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.TranslateAndDispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       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 ChartingComparison.App.Main() in C:\Users\Chris\Documents\Visual Studio 2010\Projects\WpfGraph\ChartingComparison\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       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: 

Ves
Telerik team
 answered on 18 Mar 2013
10 answers
430 views
I created a layout algorithm similar to what's used in the OrgChart example. I call .Layout on it when the window hosting the diagram resizes and also call AutoFit on the diagram. Works perfectly once the window is resized. The problem I'm having, however, is that when the window first loads, the shapes are all stacked in the upper left corner. When is the proper time to run the same algorithm to get an initial layout and auto fit? Is there an event we can hook when the diagram is ready for layout?
Petar Mladenov
Telerik team
 answered on 18 Mar 2013
1 answer
169 views
When adding a GridViewHyperlinkColumn to a GridView I expect the links to adapt to the current theme. I'm currently using Expression Dark and the links are vivid blue. Not so nice...

I consider this a bug. Your links should adapt to the current theme!

I tried overriding the style...

<Grid.Resources>
  <Style TargetType="{x:Type telerikGrid:HyperlinkButton}">
  <Setter Property="Foreground" Value="White" />
  </Style>
</Grid.Resources>

<telerik:GridViewHyperlinkColumn Header="Link" />

Doesn't work.
Vanya Pavlova
Telerik team
 answered on 18 Mar 2013
2 answers
76 views
Hi,
Im having troubles when having two dataseries in chart.
The series have different start and end dates that do not intersect.

The problem is that mars displays twice and the months seem to fall in wrong month (see attachment)
In the picture the blue (history) series should start in November and end in March.
The green (2013) series should start in April and end in December.

Here is the code that creates the series.
private DataSeries createDataSeries(List<ChartData> data, string legendLabel = "")
        {
            DataSeries series              = new DataSeries();
            BarSeriesDefinition definition = new BarSeriesDefinition();
            definition.ShowItemToolTips    = true;
            definition.ShowItemLabels      = false;
            series.Definition              = definition;
            series.LegendLabel             = legendLabel;
            foreach (ChartData item in data)
            {
                DataPoint dataPoint   = new DataPoint();
                dataPoint.YValue      = item.Value;
                dataPoint.XValue = item.Caption.ToOADate();
                dataPoint.IsDateTime = true;
                dataPoint.LabelFormat = "MMM";
                series.Add(dataPoint);
                count++;
            }
            return series;
        }

Can you help me you  ?
-k
Kristjan Einarsson
Top achievements
Rank 1
 answered on 18 Mar 2013
3 answers
171 views
Hi

 I am using Docking and all my RadPanel's have content controls that support scrollbars except for one RadPane.  I can get scrollbars by using the microsoft scrollviewer but my whole screen looks weird because one panel has a different style than all the others.  It seems that this defeats the purpose of using themes.  If there are xaml styles already built for this could they be provided with detail instructions on how to incorporate.  I have limited xaml experience and zero Blend experience.  I use third-party controls so I can concentrate on the c# part of the app without having to worry to much about xaml. 

Thanks
Rich
Masha
Telerik team
 answered on 18 Mar 2013
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?