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

Error when setting ShowButtons="False"

7 Answers 195 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
joshua odell
Top achievements
Rank 1
joshua odell asked on 01 Sep 2009, 05:46 PM
I'm getting the following exception when I try to set the ShowButtons property of the RadNumericUpDown to false

Cannot animate the 'Visibility' property on a 'System.Windows.Controls.Grid' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception.

Here's the full exception
System.Windows.Media.Animation.AnimationException was unhandled
  Message="Cannot animate the 'Visibility' property on a 'System.Windows.Controls.Grid' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. 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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       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.Application.RunInternal(Window window)
       at Shell.App.Main() in D:\V\Code\Production\Sizing\Shell\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       Message="The animation(s) applied to the 'Visibility' property calculate a current value of 'Collapsed', which is not a valid value for the property."
       Source="PresentationCore"
       StackTrace:
            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: 

and here's the XAML that I'm using for the control

        <telerik:RadNumericUpDown Grid.Column="1" 
                                  x:Name="inpPMax" Style="{StaticResource InputNumbers}" 
                                  ValueFormat="Numeric" NumberFormatInfo="{Binding Path=DisplayFormat}" 
                                  ShowButtons="False" 
                                  IsEnabled="{Binding Path=UserEntered}" 
                                  Minimum="{Binding Path=Minimum}" Maximum="{Binding Path=Maximum}" 
                                  SmallChange="1" LargeChange="10" GotFocus="inpPMax_GotFocus"
            <telerik:RadNumericUpDown.Value> 
                <Binding Path="DisplayValue"  Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True"/> 
            </telerik:RadNumericUpDown.Value> 
        </telerik:RadNumericUpDown> 
 
 
            <Style x:Key="InputNumbers" TargetType="{x:Type telerik:RadNumericUpDown}"
                <Setter Property="Height" Value="25"/> 
                <Setter Property="FontSize" Value="12"/> 
                <Setter Property="Margin" Value="2"/> 
                <Setter Property="HorizontalContentAlignment" Value="Right"/> 
            </Style> 

this exception only occurs when the view becomes active.  Meaning I only see the exception when the tab that holds these RadNumericUpDown controls has been activated.


thanks

Josh

7 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 02 Sep 2009, 09:52 PM
Hello joshua odell,

I am unable to reproduce the same problem on my computer. Would you try removing the style property of the control and check whether it will make any difference. Do you have the same problem without using a new style or only in this case?

Kind regards,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
joshua odell
Top achievements
Rank 1
answered on 03 Sep 2009, 03:06 AM
I added a brand new RadNumericUpDown

<telerik:RadNumericUpDown Grid.Row="2" Grid.Column="2" ShowButtons="False" /> 

But it has the same effect.  I'm sure it's something that I'm doing wrong, I created a brand new app and was able to disable the buttons with no issue.  So I'm sure there's something holding this up, but to be honest I'm not really sure where to look.  as you can see the above control has no style, in fact it has nothing at all, no binding and no formatting, and it still has the same issue.

Do you know where I may be able to start looking to track down this issue.  it only seems to happen when I add a radnumericupdown and set showButtons=false, all the other controls werk perfectly.

Thanks for the help.

Josh
0
Hristo Borisov
Telerik team
answered on 04 Sep 2009, 09:37 AM
Hello joshua odell,

Do you apply any general style or theme on the controls? The only reason you can get such an error is if you are overriding the default style of the control, and the new one doesn't appear to have a proper definition of the show button visual state. If you are not using a theme, you can send us a sample project that isolates the issue so we can investigate it further.

Thank you for contacting us and we look forward to receiving your solution.

Greetings,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
joshua odell
Top achievements
Rank 1
answered on 22 Sep 2009, 10:15 PM
in the beginning of my application I load a theme, I just ran across it.

Telerik.Windows.Controls.StyleManager.ApplicationTheme = new SummerTheme(); 
 

I tried using VistaTheme() as well.  If I set a theme then I get the error, if I remove this line of code everything looks great.
Is there perhaps a problem with the built in themes?

On further investigation the Office_black,blue,silver themes work.  It appears to be isolated to vista and summer themes
0
Hristo Borisov
Telerik team
answered on 22 Sep 2009, 10:44 PM
Hello Joshua,

We will investigate the problem with our Vista and Summer themes as soon as possible. You should expect a working version for our next official release. Until then, please excuse us for the inconvenience caused by this omission. Thank you for contacting us, your Telerik points have been updated.

Kind regards,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
joshua odell
Top achievements
Rank 1
answered on 30 Sep 2009, 05:55 PM
Hristo.

Is there a way that I can set the theme of an individual control to something different the the applicationTheme?
then I could try to just change those controls that are having problems.

Thank you

Josh
0
Hristo Borisov
Telerik team
answered on 05 Oct 2009, 09:45 PM
Hello Joshua Odell,

No you cannot use a theme that is different from the application one. I advise you to wait for a few weeks and download our next official release that will not have issues with its themes. If this is not a convenient time-frame for you please contact us as soon as possible. Thank you for your patience and we look forward to hearing from you again.

Best wishes,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
NumericUpDown
Asked by
joshua odell
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
joshua odell
Top achievements
Rank 1
Share this question
or