Telerik Forums
UI for WPF Forum
2 answers
168 views
My project uses a RadMenu in the upper-right of the screen.  The menu needs to open from right to left so we use the flow direction "RightToLeft".  When using this flow direction, some header text with punctuation is rearranged.  Consider this example:

<telerik:RadMenu x:Name="radMenu2" ClickToOpen="False" Grid.Column="0" FlowDirection="RightToLeft">
  <telerik:RadMenuItem Name="testMenuItem" Header="Test">
     <telerik:RadMenuItem Header="123.ABC"/>
     <telerik:RadMenuItem Header="123ABC"/>
  </telerik:RadMenuItem>
</telerik:RadMenu>

In this case, when the menu is shown the first menu item will display "ABC.123" instead of "123.ABC".  The second item (without the period) displays fine.

  Other examples: 
  •   "Test_" will display as "_Test"
  •   "(Test" will display as "Test("
  •   "100%Effort" will display as "Effort%100"

 
  For some reason, setting a flow direction of "RightToLeft" will rearrange any text that contains certain special characters.

  Is there a way to stop this reversal of the menuitem header text?

Hristo
Telerik team
 answered on 26 Jul 2013
1 answer
97 views
Hi,

I have a question about dynamic series binding.

This is code example:
public class MyViewModel
{
  public List<ChartData> chartItem {get;set;};
  public List<List<ChartData>> ChartData {get;set;};
 
}
 
public class ChartData
{
  public DateTime Xvalue{get;set;}
  public DateTime Yvalue{get;set;}
}

ChartData has some chartItem, and one ChartItem will be graph a line in the ChartView.
ChartItem's quantity is dynamic in the ChartData. 

What ways can be binding this data in the ChartView? (Lineseries are dynamic.)

Thank you.
Rosko
Telerik team
 answered on 26 Jul 2013
1 answer
330 views
Hi,

I have three columns (Eg:ID ,Name, Location) ID column is readonly. When i insert new row by setting ShowInsertRow="True" and CanUserInsertRows="True" i need to enter the value for the ID column. How to achieve this? I am following MVVM pattern.

Thanks in Advance. 
Yoan
Telerik team
 answered on 26 Jul 2013
2 answers
283 views
Greetings,


I have been evaluating your excellent RadPDFViewer control which I am pleased with.

But the ScaleFactor does not appear to be working? I set in code and nothing happens. I also set it in the DocumentChanged event as you suggest and still nothing?

I hope you can help us?

Any help would be greatly appreciated.

This is really urgent since I am a freelance contractor working on a short-term project and the client needs a very quick turn around, ideally before my contract ends very soon! :)

Many thanks,
David.
P.S. It also appears REALLY slow when used in a frame, has anyone else seen this?
Petya
Telerik team
 answered on 26 Jul 2013
1 answer
146 views
How to Suspend Find Replace Dialog when Pressing Ctrl +F
Anna
Telerik team
 answered on 26 Jul 2013
1 answer
122 views

hi

i was given a solution to enable to re-template the AxisLabel2d controls which worked fine. See attached

When i resize the window, the labels revert back to the defaulted state (timedate), initally it is fine.

My converter does nothing but return a string. I restyle using the code below (as per the suggestion by you guys)

            ChartArea area = _CA;
            HorizontalAxisLabels2D axisLabelsContainer = area.FindChildByType<HorizontalAxisLabels2D>();
            var axisLabels = axisLabelsContainer.ChildrenOfType<AxisLabel2D>();
            System.Windows.Style style = _GD.Resources["CustomLabel"] as System.Windows.Style;
            foreach (var item in axisLabels)
            {
                item.Style = style;
            }


    public class GetTextConverter : IValueConverter, IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            return "I Am HERE";
        }
       
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "I Am HERE";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException();}
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); }
    }

 


<Style x:Key="CustomLabel" TargetType="telerikCharting:AxisLabel2D">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerikCharting:AxisLabel2D">
                <Border Background="{TemplateBinding Background}">
                    <Border.DataContext>
                        <MultiBinding Converter="{StaticResource GetTextConverter}">
                            <MultiBinding.Bindings>
                                <Binding Path="DataContext" ElementName="_GD"/>
                                <Binding Path="CurrentIndex"/>
                            </MultiBinding.Bindings>
                        </MultiBinding>
                    </Border.DataContext>
                    <TextBlock Style="{TemplateBinding ItemLabelStyle}" Text="{Binding .}">
                        <TextBlock.LayoutTransform>
                            <RotateTransform x:Name="PART_RotateTransform" />
                        </TextBlock.LayoutTransform>
                    </TextBlock>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Evgenia
Telerik team
 answered on 26 Jul 2013
2 answers
157 views
Hello,

I am trying to animate the position of a RadWindow using a DataTrigger.

The following demonstrates what I am trying to achieve:

<telerik:RadWindow x:Class="TelerikRadWindow.MainWindow"
        Height="350"
        Width="525"
        WindowStartupLocation="CenterScreen">
    <telerik:RadWindow.Style>
        <Style TargetType="telerik:RadWindow">
            <Style.Triggers>
                <DataTrigger Binding="{Binding ShouldMoveWindow}" Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="(Window.Top)" To="+200" BeginTime="0:0:0" Duration="0:0:5" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadWindow.Style>
</telerik:RadWindow>

namespace TelerikRadWindow
{
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            ShouldMoveWindow = true;
            DataContext = this;
        }
 
        public bool ShouldMoveWindow { get; set; }
    }
}

When loaded, an exception is thrown:

System.Windows.Media.Animation.AnimationException was unhandled
  HResult=-2146233087
  Message=Cannot animate the 'Top' property on a 'TelerikRadWindow.MainWindow' using a 'System.Windows.Media.Animation.DoubleAnimation'. For details see the inner exception.
  Source=PresentationCore
  StackTrace:
       at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       at System.Windows.Media.Animation.Clock.FireEvent(EventPrivateKey key)
       at System.Windows.Media.Animation.Clock.RaiseAccumulatedEvents()
       at System.Windows.Media.Animation.TimeManager.RaiseEnqueuedEvents()
       at System.Windows.Media.Animation.TimeManager.Tick()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       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.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.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 TelerikRadWindow.App.Main() in c:\Users\martin.galpin\Documents\Visual Studio 2012\Projects\TelerikRadWindow\TelerikRadWindow\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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       HResult=-2146233079
       Message='System.Windows.Media.Animation.DoubleAnimation' cannot use default origin value of 'NaN'.
       Source=PresentationCore
       StackTrace:
            at System.Windows.Media.Animation.DoubleAnimation.GetCurrentValueCore(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.DoubleAnimationBase.GetCurrentValue(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.DoubleAnimationBase.GetCurrentValue(Object defaultOriginValue, Object defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.AnimationClock.GetCurrentValue(Object defaultOriginValue, Object defaultDestinationValue)
            at System.Windows.Media.Animation.AnimationLayer.GetCurrentValue(Object defaultDestinationValue)
            at System.Windows.Media.Animation.AnimationStorage.GetCurrentPropertyValue(AnimationStorage storage, DependencyObject d, DependencyProperty dp, PropertyMetadata metadata, Object baseValue)
            at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       InnerException:

This exact same sample works when using a Window rather than a RadWindow.

Does anybody have any idea why this is or what I can do to resolve it?

Many thanks.




MobiusStrip
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
112 views
is this possible?
Petya
Telerik team
 answered on 25 Jul 2013
5 answers
203 views
I am using the RadRichTextBox to input and display various types of data. So far text input works fine. However when I copy and paste an image it seems to appear in the RadRichTextBox but the actual image is invisible. I would like to have text, tables, images and files if possible inside my RadRichTextBox. Here's some code that I've tried thus far. As I understand it XamlDataProvider takes a string in xaml format as its data source. Which is fine but then I don't understand how binary files like images are handled. A code sample in the mvvm pattern would be great. Thank you.
<StackPanel>
    <telerikXaml:XamlDataProvider RichTextBox="{Binding ElementName=radRich}" Xaml="{Binding Path=XamlText, Mode=TwoWay}"></telerikXaml:XamlDataProvider>
    <telerik:RadRichTextBox x:Name="radRich" />
</StackPanel>

private string xamlText;
public string XamlText
{
    get { return xamlText; }
    set
    {
        if (xamlText != value)
        {
            xamlText = value;
            RaisePropertyChanged("XamlText");
        }
    }
}

Petya
Telerik team
 answered on 25 Jul 2013
1 answer
75 views
is it possible to perform Find Replace in MVVM?
Petya
Telerik team
 answered on 25 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?