My issues:
1. {System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.} This is a breaking bug because it crashes the silverlight client.
I cannot tell if this is an issue with telerik controls, sl5 rtm, or a combination. When I switched to SL5 RTM I have this issue with both the SL4 binaries and the SL5 binaries. I did not encounter this problem using SL5 beta w the SL4 binaries.
Other people have had a similar issue:
http://stackoverflow.com/questions/8495242/silverlight-5-accessviolationexception/8512923#8512923
http://forums.silverlight.net/t/245076.aspx/1?Error+in+project+when+upgrage+from+SL4+to+SL5
In our project it is thrown after a SelectedValue binding changes. The error is thrown on line 3047 "this.EditableTextBox.Text = text" in the UpdateEditableTextBox() method of RadComboBox.cs
I am working on reproducing this in a sample project.
2. Handling the CellDoubleClickEvent on RadGridView does not work with the SL5 binaries, but it does w SL4 binaries. See the sample code https://docs.google.com/open?id=0Bx6l5GmEYzJJYmJiYWRmYjQtMzliYy00NWU1LTk1YjYtZDg4ZTQ5M2RmMTk4
34 Answers, 1 is accepted
Straight onto your problems:
1) I am afraid that I also was unable to reproduce this problem with a simple application, I guess there are other factors that lead to this exception. I would need more detail about your application:
- the RadComboBox declaration - a code snippet would be best, if you could send the related code-behind it would be also of great help (event handlers, configuration, etc.)
- the theme used - whether it is a standard Telerik theme or a custom
- environment - please check again if you are using our SL5 assemblies (the best way is to open the XAP file and check the file versions)
- the controls around - whether the combobox is put in another control - ChildWindow, RadWindow, Docking, etc.
- steps to reproduce - does the exception occur when the control is shown for the first time, do you have to click or type inside it in order to throw the exception, etc., whatever could be of help.
2) You can check this demo for more info about CellDoubleClick. Everything is working normally so far.
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Just a quick update! We've managed to reproduce the double click problem with the grid and we are looking currently what is causing this wrong behavior.
We will update this thread once we have more info!
Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We were able to fix the cell double click issue for our Silverlight 5 binaries and the fix will be part of our next internal build (next week).
All the best,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Hi,
I got the same issue with "{System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.}"
One way to cause this error is to set celledittemplate on a radgridview column that contains a editable radcombobox and also a button that shows a childwindow. Upon closing the childwindow the selecteditem/value is updated with a new value which usually causes this exception.
I think this is caused by the fact the childwindow is opened the cell goes back into normal state and when the childwindow is closed
the binding is updated and exception is thrown on the propertychanged event.
I've submitted a support ticket including an example, the support ticket ID is: 495383
Tomas
I found two workarounds for the problem:
1) Edit in the EditableTemplate template and set Foreground on the PickerTextBox control.
2) Create a new control deriving from RadComboBox and put the following code inside:
public class FixedComboBox : RadComboBox
{
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
var editableTextBox = (TextBox)this.GetTemplateChild("PART_EditableTextBox");
if (editableTextBox != null)
{
editableTextBox.Foreground = this.Foreground;
}
}
}
Unfortunately both will break the automatic inheritance of the Foreground property, but at least will not throw exceptions.
I will write again if I find something better.
Regards,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Can you tell me when will be released a fixed version? I need them asap.
I think we made some progress today, we did some rearranging in the RadComboBox control template and I believe we successfully workarounded the problem. We are unable to reproduce it with the projects we have so far, and the next internal build on Monday will contain the fix, please check it out and let me know if the exception is still thrown.
All the best,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
"I'm seeing this exception when databinding to a hidden element. We have some fields that are visible or not based on some databinding, but both of those fields are updated with another databinding. When the RaisePropertyChanged is fired on the hidden field we get the AccessViolationException. I had to add some checks to my code to suppress the RaisePropertyChanged when the control isn't visible. "
I have a 2 RadComboBoxes binding to the same SelectedItem, and one of them is hidden. This is in a form, and if the user toggles a button, the one that was visibile is now hidden and the hidden one becomes visible. When I click the now visible drop down, I get:
{System.AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.}
Thanks,
Bryce
An AccessViolationException would seem to indicate a SL runtime bug, are Microsoft aware of this issue?
The best workaround we have found so far is to replace the PickerTextBox control from the RadComboBox control template with a regular TextBox and this is implemented in internal build version 2011.3.1316 (January 16th). If you have a custom control template for RadComboBox I strongly recommend replacing the PickerTextBox with a TextBox and updating the visual states.
Please, find attached a project that was used to test the exception and let me know if the problem persists on your side. If it does, please send me a project that can be used to observe it and we will do our best to provide a fix as soon as possible. The exception can be observed in both Silverlight 4 and 5 applications.
RadDateTimePicker and RadNumericUpDown suffer from the same problem and will be updated with the internal build next week.
@Anthony: Yes, Microsoft is aware of this problem and we are waiting for a final conclusion. I believe there is a bug in the Silverlight runtime, the attached solution has a test with plain Silverlight controls that is also able to reproduce the exception.
All the best,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Microsoft have historically been very poor at communicating with developers on this sort of issue (c.f. the SL4 memory leak fiasco), so any additional information that Telerik can pass on would be very much appreciated. Also, please do let us know if there is a corresponding Microsoft connect issue or similar that we can vote or comment on.
We submitted a bug report to Microsoft, please vote so that it could be fixed as soon as possible:
https://connect.microsoft.com/VisualStudio/feedback/details/719572
Regardless of that we will try to provide a fix in our controls too.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
The fix for RadNumericUpDown didn't make it for the internal build. We made the fix but it will be available for next week's internal build.
We are sorry for the inconvenience. Let us know if you have further questions.
Regards,
Boyan
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Should this have been fixed in Q1 2012 or will I need an internal build to resolve this error?
The fix should be there. We made some tests with the project Valeri send below for both RadComboBox and RadNumericUpDown and with the latest version of the controls (2012.1.215.1050) no error was observed. The fix that changed the element to Textbox instead of PickerTextbox is there (you can see with a tool like silverlight spy).
The problem might be that this fix does not handle all scenarios. Could you please send me a project that the problem can be seen with the latest binaries.
All the best,
Boyan
the Telerik team
In my case I kind of know the circumstances that cause it....
I have a tree control on the left with different types of elements:
Parent Item
Child Item
Parent Item
Child Item
When you select a Parent, the right side controls fill with Parent properties, when you select a child, it fills with child properties.
The Parent and child are completely different objects so the right side has 2 sets of controls in Borders. When you click on a parent we show the parent border and hide the child border and when you click on a child we show the child border and hide the parent border...one set of controls visible at a time.
The app starts with a Parent item selected, so the Child border is hidden
If I then select a Child with a non-zero value being pushed into the UpDown, it crashes.
If the child has all *zero* values, it does not crash...maybe because the default value is zero and does not trigger a change?
As an experiment I set it so that the child border is *never* hidden and it does not crash in either the non-zero or zero case. It has some connection to the visibility state of the control when you set it.
So, my work-around which is still holding up is to force an update of the Child border before its controls are filled with values:
ChildBorder.Visibility = Visibility.Visible
ParentBorder.Visibility = Visibility.Collapsed
' THIS FIXES IT FOR ME
ChildBorder.UpdateLayout()
' Fill Child controls.
' ...
With the explicit UpdateLayout after making the border visible, I no longer have the exception, which lets me continue working.
We recently upgraded to 2012.1.0215 Telerik controls and this issue is back again.
Are you guys not carrying the HotFixes to the new releases?
Please Help in solving this isssue.
The fix should be there. We are still not able to reproduce the NumericUpDown problem with the latest version of the controls (2012.1.215.1050). I double checked this and the fix that changed the element to Textbox instead of PickerTextbox is there.
It will be best if someone could send us a sample project where the error can be reproduced with Q1 version of the controls so we can see what is causing the problem. The problem may be in a specific scenario or for a specific theme.
Regards,
Boyan
the Telerik team
[StyleTypedProperty(Property =
"CalendarStyle"
, StyleTargetType =
typeof
(RadCalendar))]
[StyleTypedProperty(Property =
"ClockStyle"
, StyleTargetType =
typeof
(RadClock))]
public
partial
class
RadDateTimePicker : Control, IThemable
{
// ...
public
string
DateTimeText
{
get
{
return
(
string
)GetValue(DateTimeTextProperty); }
set
{ SetValue(DateTimeTextProperty, value); }
// <- Crash here
}
}
I don't know how to attach the sample app since only images appear to be allowed so here is the XAML and the code:
MainPage.xaml:
<
UserControl
x:Class
=
"SilverlightApplication2.MainPage"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
xmlns:sdk
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadNumericUpDown
HorizontalAlignment
=
"Left"
Name
=
"RadNumericUpDown1"
VerticalAlignment
=
"Top"
/>
</
Grid
>
</
UserControl
>
MainPage.vb: set property on UpDown on page load. This throws exception every time for me.
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
Private Sub MainPage_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
RadNumericUpDown1.NumberFormatInfo.NumberGroupSeparator = ""
End Sub
End Class
@John
Few releases back we changed the behavior of RadNumericUpDown and now you have to create a new instance of NumberFormatInfo as RadNumericUpDown doesn't have a default one. You have to change your code to:
RadNumericUpDown1.NumberFormatInfo =
New
NumberFormatInfo()
With
{
.NumberGroupSeparator =
""
}
@Patrik
Are you using the latest 2012.1.215 version of the controls? You can't attach a project to a forum thread, in order to attach a project you have to open a support thread or a Bug report.
Greetings,
Boyan
the Telerik team
I'm actually running 2011.1.0411.1040. We haven't actually had any possibilities to update to a newer version because some major bugs were introduced in the summer release. I reinstalled Silverlight Version 4 developer runtime and the error disappeared.
Best regards,
Patrik
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"textbox"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"#FF8D8D8D"
/>
</
ObjectAnimationUsingKeyFrames
>
If I comment this part AccessViolationException disappear. Best regards,
Predrag
I tested the xaml generated from Expression Blend and the SP1 distributed xaml for both SL4 and SL5. As neither contains this particular xaml snippet and I could not reproduce this exception, could you share how you obtained the xaml? Basically, the brush sould be set as a StaticResource, not inline. Other than that there is nothing unusual about the disabled state of RadNumericUpDown.
Kind regards,
Dani
the Telerik team
This is complete style for RadNumericUpDown:
<
ResourceDictionary
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
xmlns:Controls
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:Telerik_Windows_Controls_Chromes
=
"clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
xmlns:System
=
"clr-namespace:System;assembly=mscorlib"
>
<
SolidColorBrush
x:Key
=
"ButtonIconBackground_Normal"
Color
=
"#FFFFFFFF"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconForeground_Normal"
Color
=
"#FF000000"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconForeground_MouseOver"
Color
=
"#FF000000"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconBackground_MouseOver"
Color
=
"#FFFFFFFF"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconForeground_Disabled"
Color
=
"#FF8D8D8D"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconBackground_Disabled"
Color
=
"#FFFFFFFF"
/>
<
CornerRadius
x:Key
=
"SplitButton_LeftPartCornerRadius"
>1 0 0 1</
CornerRadius
>
<
CornerRadius
x:Key
=
"SplitButton_TopRightPartCornerRadius"
>0 1 0 0</
CornerRadius
>
<
ControlTemplate
x:Key
=
"ArrowTemplate_Up"
TargetType
=
"ContentControl"
>
<
Grid
Margin
=
"5 0"
>
<
Path
x:Name
=
"BackgroundIcon"
Data
=
"M0,1 L1,0 2,1 Z"
Fill
=
"{TemplateBinding Background}"
Height
=
"3"
Margin
=
"0 2 0 0"
Stretch
=
"Fill"
Width
=
"5"
/>
<
Path
x:Name
=
"ForegroundIcon"
Data
=
"M0,1 L1,0 2,1 Z"
Fill
=
"{TemplateBinding Foreground}"
Height
=
"3"
Margin
=
"0 1 0 1"
Stretch
=
"Fill"
Width
=
"5"
/>
</
Grid
>
</
ControlTemplate
>
<
SolidColorBrush
x:Key
=
"ControlOuterBorder_MouseOver"
Color
=
"#FFFFC92B"
/>
<
SolidColorBrush
x:Key
=
"ControlOuterBorder_Disabled"
Color
=
"#FF989898"
/>
<!-- changed: #FFB4B4B4 {StaticResource ControlOuterBorder_Disabled} -->
<
SolidColorBrush
x:Key
=
"PickerForeground_Disabled"
Color
=
"#FF8D8D8D"
/>
<!-- changed: #FFE0E0E0 {StaticResource ControlBackground_Disabled} -->
<
SolidColorBrush
x:Key
=
"ControlBackground_Disabled"
Color
=
"Transparent"
/>
<
SolidColorBrush
x:Key
=
"ControlOuterBorder_Focused"
Color
=
"#FFFFC92B"
/>
<
SolidColorBrush
x:Key
=
"ControlInnerBorder_Focused"
Color
=
"Transparent"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconForeground_Pressed"
Color
=
"#FF000000"
/>
<
SolidColorBrush
x:Key
=
"ButtonIconBackground_Pressed"
Color
=
"#FFFFFFFF"
/>
<
SolidColorBrush
x:Key
=
"ControlOuterBorder_Normal"
Color
=
"#FF848484"
/>
<
SolidColorBrush
x:Key
=
"PickerForeground_Normal"
Color
=
"#FF000000"
/>
<
SolidColorBrush
x:Key
=
"PickerBackground_Normal"
Color
=
"#FFFFFFFF"
/>
<
Style
x:Key
=
"IncreaseButtonStyle"
TargetType
=
"RepeatButton"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource ButtonIconBackground_Normal}"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource ButtonIconForeground_Normal}"
/>
<
Setter
Property
=
"MinWidth"
Value
=
"15"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"RepeatButton"
>
<
Grid
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
/>
<
VisualState
x:Name
=
"MouseOver"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_MouseOver}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_MouseOver}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Pressed"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_Pressed}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_Pressed}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Disabled"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
ContentPresenter
/>
<
ContentControl
x:Name
=
"Arrow"
Background
=
"{TemplateBinding Background}"
Foreground
=
"{TemplateBinding Foreground}"
IsTabStop
=
"False"
Template
=
"{StaticResource ArrowTemplate_Up}"
/>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
<
CornerRadius
x:Key
=
"SplitButton_BottomRightPartCornerRadius"
>0 0 1 0</
CornerRadius
>
<
ControlTemplate
x:Key
=
"ArrowTemplate_Down"
TargetType
=
"ContentControl"
>
<
Grid
Margin
=
"5 0"
>
<
Path
x:Name
=
"BackgroundIcon"
Data
=
"M0,0 L2,0 1,1 Z"
Fill
=
"{TemplateBinding Background}"
Height
=
"3"
Margin
=
"0 2 0 0"
Stretch
=
"Fill"
Width
=
"5"
/>
<
Path
x:Name
=
"ForegroundIcon"
Data
=
"M0,0 L2,0 1,1 Z"
Fill
=
"{TemplateBinding Foreground}"
Height
=
"3"
Margin
=
"0 1 0 1"
Stretch
=
"Fill"
Width
=
"5"
/>
</
Grid
>
</
ControlTemplate
>
<
Style
x:Key
=
"DecreaseButtonStyle"
TargetType
=
"RepeatButton"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource ButtonIconBackground_Normal}"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource ButtonIconForeground_Normal}"
/>
<
Setter
Property
=
"MinWidth"
Value
=
"15"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"RepeatButton"
>
<
Grid
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
/>
<
VisualState
x:Name
=
"MouseOver"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_MouseOver}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_MouseOver}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Pressed"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_Pressed}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_Pressed}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Disabled"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconForeground_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Arrow"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ButtonIconBackground_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
ContentPresenter
/>
<
ContentControl
x:Name
=
"Arrow"
Background
=
"{TemplateBinding Background}"
Foreground
=
"{TemplateBinding Foreground}"
IsTabStop
=
"False"
Template
=
"{StaticResource ArrowTemplate_Down}"
/>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
<
CornerRadius
x:Key
=
"SplitButton_TopPartCornerRadius"
>1 1 0 0</
CornerRadius
>
<
CornerRadius
x:Key
=
"SplitButton_BottomPartCornerRadius"
>0 0 1 1</
CornerRadius
>
<
ControlTemplate
x:Key
=
"RadNumericUpDownTemplate"
TargetType
=
"telerik:RadNumericUpDown"
>
<
Grid
x:Name
=
"LayoutRoot"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
x:Name
=
"colDefText"
Width
=
"*"
/>
<
ColumnDefinition
x:Name
=
"colDefButtons"
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
>
<
Storyboard
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"MouseOverVisual"
>
<
LinearDoubleKeyFrame
KeyTime
=
"0:0:0.150"
Value
=
"0"
/>
</
DoubleAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"MouseOverVisual"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0.150"
>
<
DiscreteObjectKeyFrame.Value
>
<
Visibility
>Collapsed</
Visibility
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"MouseOver"
>
<
Storyboard
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"MouseOverVisual"
>
<
LinearDoubleKeyFrame
KeyTime
=
"0:0:0.115"
Value
=
"1"
/>
</
DoubleAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"MouseOverVisual"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0"
>
<
DiscreteObjectKeyFrame.Value
>
<
Visibility
>Visible</
Visibility
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderActive"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>True</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderActive"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>True</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"MouseOverTextHidden"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"Border"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ControlOuterBorder_MouseOver}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Disabled"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"Border"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource ControlOuterBorder_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Foreground"
Storyboard.TargetName
=
"textbox"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource PickerForeground_Disabled}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"Background"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Transparent"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderEnabled"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderEnabled"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"TextBoxBehavior"
>
<
VisualState
x:Name
=
"ShowTextBox"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"textbox"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(ColumnDefinition.Width)"
Storyboard.TargetName
=
"colDefText"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"*"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(ColumnDefinition.Width)"
Storyboard.TargetName
=
"colDefButtons"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"auto"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderFocused"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderFocused"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"HideTextBox"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"textbox"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Collapsed"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(ColumnDefinition.Width)"
Storyboard.TargetName
=
"colDefText"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"auto"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(ColumnDefinition.Width)"
Storyboard.TargetName
=
"colDefButtons"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"*"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"CornerRadius"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource SplitButton_TopPartCornerRadius}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"CornerRadius"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource SplitButton_BottomPartCornerRadius}"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderActive"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderActive"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>False</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"Background"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Collapsed"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"ButtonsBehavior"
>
<
VisualState
x:Name
=
"ShowButtons"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"increase"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"decrease"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"HideButtons"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"increase"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Collapsed"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"(UIElement.Visibility)"
Storyboard.TargetName
=
"decrease"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Collapsed"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"CornerRadius"
Storyboard.TargetName
=
"Background"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource SplitButton_SpanCornerRadius}"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"ValidationStates"
>
<
VisualState
x:Name
=
"Valid"
/>
<
VisualState
x:Name
=
"InvalidUnfocused"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"ValidationTooltip"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"InvalidFocused"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"ValidationTooltip"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"IsOpen"
Storyboard.TargetName
=
"ValidationTooltip"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0.1"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>True</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"FocusStates"
>
<
VisualState
x:Name
=
"Focused"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"FocusVisual"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"Visible"
/>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderFocused"
Storyboard.TargetName
=
"increaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>True</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"RenderFocused"
Storyboard.TargetName
=
"decreaseButtonChrome"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
System:Boolean
>True</
System:Boolean
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"FocusedTextHidden"
/>
<
VisualState
x:Name
=
"Unfocused"
/>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
Border
x:Name
=
"Background"
Background
=
"{StaticResource PickerBackground_Normal}"
Grid.Column
=
"0"
CornerRadius
=
"{StaticResource SplitButton_LeftPartCornerRadius}"
Grid.RowSpan
=
"2"
/>
<
Border
Background
=
"{TemplateBinding Background}"
Grid.ColumnSpan
=
"2"
CornerRadius
=
"{StaticResource SplitButton_SpanCornerRadius}"
Grid.RowSpan
=
"2"
/>
<
Border
x:Name
=
"Border"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Grid.ColumnSpan
=
"2"
CornerRadius
=
"{StaticResource SplitButton_SpanCornerRadius}"
Grid.RowSpan
=
"2"
/>
<
Border
x:Name
=
"MouseOverVisual"
BorderBrush
=
"{StaticResource ControlOuterBorder_MouseOver}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Grid.ColumnSpan
=
"2"
CornerRadius
=
"{StaticResource SplitButton_SpanCornerRadius}"
IsHitTestVisible
=
"False"
Opacity
=
"0"
Grid.RowSpan
=
"2"
Visibility
=
"Collapsed"
/>
<
Controls:PickerTextBox
x:Name
=
"textbox"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Grid.Column
=
"0"
HorizontalContentAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
Padding
=
"{TemplateBinding Padding}"
Grid.Row
=
"0"
Grid.RowSpan
=
"2"
Controls:StyleManager.Theme
=
"{StaticResource Theme}"
VerticalContentAlignment
=
"{TemplateBinding VerticalContentAlignment}"
/>
<
Border
x:Name
=
"FocusVisual"
BorderBrush
=
"{StaticResource ControlOuterBorder_Focused}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Grid.ColumnSpan
=
"2"
CornerRadius
=
"{StaticResource SplitButton_SpanCornerRadius}"
Grid.RowSpan
=
"2"
Visibility
=
"Collapsed"
>
<
Border
BorderBrush
=
"{StaticResource ControlInnerBorder_Focused}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
CornerRadius
=
"{StaticResource SplitButton_SpanInnerCornerRadius}"
/>
</
Border
>
<
RepeatButton
x:Name
=
"increase"
Grid.Column
=
"1"
IsTabStop
=
"{TemplateBinding AreButtonsTabStops}"
Grid.Row
=
"0"
Style
=
"{StaticResource IncreaseButtonStyle}"
>
<
Telerik_Windows_Controls_Chromes:ButtonChrome
x:Name
=
"increaseButtonChrome"
BorderBrush
=
"{TemplateBinding BorderBrush}"
CornerRadius
=
"{StaticResource SplitButton_TopRightPartCornerRadius}"
IsTabStop
=
"False"
RenderMouseOver
=
"{Binding IsMouseOver, ElementName=increase}"
RenderPressed
=
"{Binding IsPressed, ElementName=increase}"
RenderFocused
=
"{Binding IsFocused, ElementName=increase}"
Controls:StyleManager.Theme
=
"{StaticResource Theme}"
/>
</
RepeatButton
>
<
RepeatButton
x:Name
=
"decrease"
Grid.Column
=
"1"
IsTabStop
=
"{TemplateBinding AreButtonsTabStops}"
Grid.Row
=
"1"
Style
=
"{StaticResource DecreaseButtonStyle}"
>
<
Telerik_Windows_Controls_Chromes:ButtonChrome
x:Name
=
"decreaseButtonChrome"
BorderBrush
=
"{TemplateBinding BorderBrush}"
CornerRadius
=
"{StaticResource SplitButton_BottomRightPartCornerRadius}"
IsTabStop
=
"False"
RenderMouseOver
=
"{Binding IsMouseOver, ElementName=decrease}"
RenderPressed
=
"{Binding IsPressed, ElementName=decrease}"
RenderFocused
=
"{Binding IsFocused, ElementName=decrease}"
Controls:StyleManager.Theme
=
"{StaticResource Theme}"
/>
</
RepeatButton
>
<
Telerik_Windows_Controls_Chromes:ValidationTooltip
x:Name
=
"ValidationTooltip"
Grid.ColumnSpan
=
"2"
Grid.RowSpan
=
"2"
TooltipPlacementTarget
=
"{Binding RelativeSource={RelativeSource TemplatedParent}}"
Controls:StyleManager.Theme
=
"{StaticResource Theme}"
TooltipContent
=
"{Binding (Validation.Errors), RelativeSource={RelativeSource TemplatedParent}}"
Visibility
=
"Collapsed"
/>
</
Grid
>
</
ControlTemplate
>
<
Style
x:Key
=
"RadNumericUpDownStyle1"
TargetType
=
"telerik:RadNumericUpDown"
>
<
Setter
Property
=
"Template"
Value
=
"{StaticResource RadNumericUpDownTemplate}"
/>
<
Setter
Property
=
"MinHeight"
Value
=
"22"
/>
<
Setter
Property
=
"MinWidth"
Value
=
"60"
/>
<
Setter
Property
=
"Padding"
Value
=
"4 0"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{StaticResource ControlOuterBorder_Normal}"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource PickerForeground_Normal}"
/>
<
Setter
Property
=
"Background"
Value
=
"Transparent"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Right"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"IsTabStop"
Value
=
"false"
/>
</
Style
>
</
ResourceDictionary
>
RadNumericUpDown used in different pages inside DataForm. The problem exists for all of them. Like I mentioned it works fine with Sl4 RTM, and with Sl5 it works only if i disable part where I set Foreground of textbox for "Disabled" VisualState (this is only place where I actually change Foreground of textbox, I don't think it has anything to do with disabled state, it is something related with setting foreground of textbox).
Best regards,
Predrag
I could not get the exception using your style. However, there are a few other exceptions related to missing resources.
Also, an important thing to note is that since 2012 Q1 RadNumericUpDown uses a regular TextBox control instead of PickerTextBox in its control template.
I suggest that you upgrade to 2012 Q1 or 2012 Q1 SP1 version of the controls, because the style you are using seems outdated. Let me know if you have any issues with the updated one.
I am attaching here a copy of the latest xaml for RadNumericUpDown for reference.
Regards,
Dani
the Telerik team
It works perfectly! Thank you very much on your help!
I think problem was PickerTextBox, changing it to regular TextBox solved the problem.
Best regards,
Predrag