Telerik Forums
UI for WPF Forum
3 answers
135 views
If I add a Column Header or Footer to a GridViewColumn an InvaidOperationException is thrown with a message of "Specified element is already the logical child of another element. Disconnect it first." when I attempt to change the Theme. If I comment out the footer, there is no exception and the theme changes as expected.

Below are the exception details and following that, the the xaml for the RadGridView.

System.InvalidOperationException was unhandled
Message=Specified element is already the logical child of another element. Disconnect it first.
Source=PresentationFramework
StackTrace:
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.AddLogicalChild(Object child)
at System.Windows.Controls.ContentControl.OnContentChanged(Object oldContent, Object newContent)
at System.Windows.Controls.ContentControl.OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.GridView.GridViewFooterRow.PrepareCellProperties(GridViewFooterCell cell, GridViewColumn column) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Rows\GridViewFooterRow.cs:line 277
at Telerik.Windows.Controls.GridView.GridViewFooterRow.PrepareCell(GridViewCellBase cellBase, GridViewColumn column) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Rows\GridViewFooterRow.cs:line 220
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.PrepareCell(GridViewCellBase cell, GridViewColumn column) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 410
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.GetVirtualizedCell(GridViewColumn column, Boolean createIfNull) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 399
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 334
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells() in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 269
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 306
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.ItemsPresenter.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.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
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 Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(Size constraint) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Rows\GridViewRowItem.cs:line 215
at Telerik.Windows.Controls.GridView.GridViewFooterRow.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Rows\GridViewFooterRow.cs:line 172
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
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.ScrollViewer.MeasureOverride(Size constraint)
at Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(Size constraint) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\ScrollViewer\GridViewScrollViewer.cs:line 179
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
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 Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size constraint) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 6576
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
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.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, 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, 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.WrappedInvoke(Delegate callback, 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.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at AM.NET.App.Main() in C:\Dev\Genesis\AM.NET\AM.NET\obj\Debug\App.g.cs:line 50
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
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:

Hopefully there is a work around.


<telerik:RadGridView AutoGenerateColumns="False"
                     Width="498"
                     ShowGroupPanel="False"
                     Margin="0,5,0,0"
                     Height="200"
                     ItemsSource=" "
                     ShowColumnFooters="True"
                     telerik:StyleManager.Theme="{Binding TelerikTheme}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewColumn Header="Period"
                                Width="150">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <TextBlock Text="Some Data" />
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
            <telerik:GridViewColumn.Footer>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Period Range"
                               FontWeight="Bold" />
                </StackPanel>
            </telerik:GridViewColumn.Footer>
        </telerik:GridViewColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
Vlad
Telerik team
 answered on 15 Jun 2012
3 answers
137 views
I am using the StyleManager.ApplicationTheme function to set the theme of my app. When I assign MetroTheme() everything works fine, but if I assign any of the others (like Expression_DarkTheme), the app crashes with a NullReferenceException in PresentationFramework.dll when I try to show a new window that's docked.
The app starts up fine and shows the correct theming, but when I click on the button that shows my window, the exception is thrown.
Usually the location is in the MeasureOverride() functions of on the the Panels (I've seen it in ProportionalStackPanel and DockingPanel)

I'm setting the theme as per the documentation in my constructor. This is my code:
public MainWindow()
{
  //StyleManager.ApplicationTheme = new Expression_DarkTheme();  // Crashes
  StyleManager.ApplicationTheme = new MetroTheme();
  //StyleManager.ApplicationTheme = new VistaTheme();            // Crashes
  //StyleManager.ApplicationTheme = new Windows7Theme();         // Crashes
  //StyleManager.ApplicationTheme = new Office_BlackTheme();     // Crashes
  //StyleManager.ApplicationTheme = new Office_SilverTheme();    // Crashes
  //StyleManager.ApplicationTheme = new TransparentTheme();      // Crashes
 
  InitializeComponent();
  DataContext = ViewModel = new ShellViewModel();
}


This is the callstack:
at System.Windows.StyleHelper.GetInstanceValue(UncommonField`1 dataField, DependencyObject container, FrameworkElement feChild, FrameworkContentElement fceChild, Int32 childIndex, DependencyProperty dp, Int32 i, EffectiveValueEntry& entry)
at System.Windows.StyleHelper.GetChildValueHelper(UncommonField`1 dataField, ItemStructList`1& valueLookupList, DependencyProperty dp, DependencyObject container, FrameworkObject child, Int32 childIndex, Boolean styleLookup, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot)
at System.Windows.StyleHelper.GetChildValue(UncommonField`1 dataField, DependencyObject container, Int32 childIndex, FrameworkObject child, DependencyProperty dp, FrugalStructList`1& childRecordFromChildIndex, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot)
at System.Windows.StyleHelper.GetValueFromStyleOrTemplate(FrameworkObject fo, DependencyProperty dp, EffectiveValueEntry& entry)
at System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp)
at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
at System.Windows.StyleHelper.DoThemeStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style style)
at System.Windows.StyleHelper.UpdateThemeStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style& themeStyleCache)
at System.Windows.FrameworkElement.OnThemeStyleChanged(DependencyObject d, Object oldValue, Object newValue)
at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
at Telerik.Windows.Controls.Docking.RadGridResizer.OnInitialized(EventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\RadGridResizer.cs:line 360
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
at System.Xaml.XamlObjectWriter.Logic_EndInit(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndObject()
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at Telerik.Windows.Controls.ProportionalStackPanel.MeasureOverride(Size availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ProportionalStackPanel.cs:line 205
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.ItemsPresenter.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.Grid.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.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
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.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, 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, 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.WrappedInvoke(Delegate callback, 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.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at ToolsFramework.App.Main() in C:\SD\Main-1\users\rpetrie\ToolsFramework\ToolsFramework\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
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()

Do I need to do anything special to enable these themes? Copy some DLLs? Compile some themed DLL?

- Lutz
Vlad
Telerik team
 answered on 15 Jun 2012
4 answers
305 views
In the xaml file below I have two RadComboBoxes: In the top one I set the theme to MetroTheme. For the bottom RadComboBox, in Blend I selected "Edit Template", "Edit a copy", and in the template I replaced all occurrences of the office_black theme with the Metro theme.
The top combobox works as expected, but the bottom one doesn't respond to mouse input and doesn't look right. Is this a bug or am I doing something wrong?

I use version 2012.2.607.40

<Window
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
    x:Class="RadComboBoxStyle.MainWindow"
    Title="MainWindow" Height="350" Width="525">
 
    <Window.Resources>
        <Style x:Key="RadComboBoxStyle" TargetType="{x:Type telerik:RadComboBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                        <Grid x:Name="VisualRoot">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FF8D8D8D"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderEnabled" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>False</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderMouseOver" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="DropDownOpen">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" CornerRadius="1" IsHitTestVisible="False"/>
                            <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Foreground="{TemplateBinding Foreground}" IsTabStop="False" InnerCornerRadius="0" Margin="0" Padding="0">
                                <telerik:StyleManager.Theme>
                                    <telerik:MetroTheme/>
                                </telerik:StyleManager.Theme>
                                <telerik:RadToggleButton.Template>
                                    <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                    </ControlTemplate>
                                </telerik:RadToggleButton.Template>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsFocused}" RenderEnabled="{TemplateBinding IsEnabled}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:MetroTheme/>
                                        </telerik:StyleManager.Theme>
                                    </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                    <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Margin="1"/>
                                    <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                        <ContentControl.Template>
                                            <ControlTemplate TargetType="{x:Type ContentControl}">
                                                <Grid Margin="5,0">
                                                    <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                    <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </ContentControl.Template>
                                    </ContentControl>
                                    <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Grid>
                            </telerik:RadToggleButton>
                            <Popup x:Name="PART_Popup">
                                <Grid x:Name="PopupRoot">
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" InnerCornerRadius="0" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:RadButton>
                                            <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Foreground="{TemplateBinding Foreground}" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                                <ItemsPresenter/>
                                            </ScrollViewer>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="EditableTemplate">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                        <Grid x:Name="VisualRoot">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FF989898"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.05" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0.05">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderEnabled" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>False</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_EditableTextBox"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FF8D8D8D"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Background">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FFE0E0E0"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.15" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0.15">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderActive" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <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">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="DropDownOpen">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="#FF282828"/>
                                                            <GradientStop Color="#FF5F5F5F" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.05" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0.05">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderFocused" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0.15">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="WatermarkStates">
                                    <VisualState x:Name="WatermarkVisible">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Watermark">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="WatermarkInvisible"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="Background" Background="White" Grid.Column="0" CornerRadius="1,0,0,1" IsHitTestVisible="False"/>
                            <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Margin="1"/>
                            <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                            <Border x:Name="MouseOverVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Opacity="0" Visibility="Collapsed"/>
                            <TextBox x:Name="PART_EditableTextBox" BorderBrush="Transparent" BorderThickness="0" Background="Transparent" Grid.Column="0" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{TemplateBinding IsReadOnly}" Margin="1,1,0,1" Padding="{TemplateBinding Padding}" VerticalAlignment="Center" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                <TextBox.Template>
                                    <ControlTemplate TargetType="{x:Type TextBox}">
                                        <Grid>
                                            <ScrollViewer x:Name="PART_ContentHost" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" IsTabStop="False" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                            </ScrollViewer>
                                        </Grid>
                                    </ControlTemplate>
                                </TextBox.Template>
                            </TextBox>
                            <Border x:Name="FocusVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Visibility="Collapsed">
                                <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
                            </Border>
                            <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" InnerCornerRadius="0" Margin="0" Padding="0">
                                <telerik:StyleManager.Theme>
                                    <telerik:MetroTheme/>
                                </telerik:StyleManager.Theme>
                                <telerik:RadToggleButton.Template>
                                    <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                    </ControlTemplate>
                                </telerik:RadToggleButton.Template>
                                <Grid>
                                    <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,1,1,0" RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderActive="{TemplateBinding IsMouseOver}" RenderEnabled="{TemplateBinding IsEnabled}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:MetroTheme/>
                                        </telerik:StyleManager.Theme>
                                    </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                    <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                        <ContentControl.Template>
                                            <ControlTemplate TargetType="{x:Type ContentControl}">
                                                <Grid Margin="5,0">
                                                    <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                    <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </ContentControl.Template>
                                    </ContentControl>
                                </Grid>
                            </telerik:RadToggleButton>
                            <TextBlock x:Name="Watermark" HorizontalAlignment="Left" IsHitTestVisible="False" Margin="5,0,0,0" Opacity="0.5" Text="{TemplateBinding EmptyText}" Visibility="Collapsed" VerticalAlignment="Center"/>
                            <Popup x:Name="PART_Popup">
                                <Grid x:Name="PopupRoot">
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" InnerCornerRadius="0" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:RadButton>
                                            <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Foreground="{TemplateBinding Foreground}" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                                <ItemsPresenter/>
                                            </ScrollViewer>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="NonEditableTemplate">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                        <Grid x:Name="VisualRoot">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FF8D8D8D"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderEnabled" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>False</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderMouseOver" Storyboard.TargetName="ButtonChrome">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="DropDownOpen">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Black"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" CornerRadius="1" IsHitTestVisible="False"/>
                            <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Foreground="{TemplateBinding Foreground}" IsTabStop="False" InnerCornerRadius="0" Margin="0" Padding="0">
                                <telerik:StyleManager.Theme>
                                    <telerik:MetroTheme/>
                                </telerik:StyleManager.Theme>
                                <telerik:RadToggleButton.Template>
                                    <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                    </ControlTemplate>
                                </telerik:RadToggleButton.Template>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsFocused}" RenderEnabled="{TemplateBinding IsEnabled}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:MetroTheme/>
                                        </telerik:StyleManager.Theme>
                                    </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                    <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Margin="1"/>
                                    <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                        <ContentControl.Template>
                                            <ControlTemplate TargetType="{x:Type ContentControl}">
                                                <Grid Margin="5,0">
                                                    <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                    <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </ContentControl.Template>
                                    </ContentControl>
                                    <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Grid>
                            </telerik:RadToggleButton>
                            <Popup x:Name="PART_Popup">
                                <Grid x:Name="PopupRoot">
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" InnerCornerRadius="0" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:RadButton>
                                            <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Foreground="{TemplateBinding Foreground}" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:MetroTheme/>
                                                </telerik:StyleManager.Theme>
                                                <ItemsPresenter/>
                                            </ScrollViewer>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="MinHeight" Value="22"/>
            <Setter Property="Padding" Value="4,0"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="BorderBrush" Value="#FF848484"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        </Style>
    </Window.Resources>
 
        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
 
        <StackPanel>
            <telerik:RadComboBox
                ItemsSource="{Binding MyItems}"
                SelectedItem="{Binding SelectedItem}"
                Width="200">
                <telerik:StyleManager.Theme>
                    <telerik:MetroTheme/>
                </telerik:StyleManager.Theme>
            </telerik:RadComboBox>
 
 
            <telerik:RadComboBox
                ItemsSource="{Binding MyItems}"
                SelectedItem="{Binding SelectedItem}"
                Width="200"
                Style="{DynamicResource RadComboBoxStyle}" />
 
        </StackPanel>
    </Grid>
</Window>
Erik
Top achievements
Rank 1
 answered on 14 Jun 2012
1 answer
117 views
Hi,

how do i get the items which i drop in the GridView?
private void RadGridView1_Drop(object sender, DragEventArgs e)
{
//Loop through all Items which are dropped?
}

Thanks best Regrds
Rene
Dimitrina
Telerik team
 answered on 14 Jun 2012
17 answers
782 views
Hi,

One of our customers is experiencing crashes on a Windows 2003. We've collected a stack trace that is pasted below. It appears there are two issues here:
1. The stack trace below, with its NullPointerException.
2. When the application crashes, the Windows Event Log shows a .NET crash due to a stack overflow. When looking at the stack trace below it appears it may also be related to the stack overflow crash (given how many loops of functions there are in the stack).

Is this crash a result of something we're doing wrong, or a bug in the code?

System.NullReferenceException: Object reference not set to an instance of an object.   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Remove(GeneratorPosition position, Int32 count, Boolean isRecycling)   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IRecyclingItemContainerGenerator.Recycle(GeneratorPosition position, Int32 count)   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupRange(IList children, IItemContainerGenerator generator, Int32 startIndex, Int32 count)   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupContainers(Int32 firstViewport, BaseItemsControl itemsControl)   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.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.ScrollContentPresenter.MeasureOverride(Size constraint)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.ScrollViewer.MeasureOverride(Size constraint)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.Decorator.MeasureOverride(Size constraint)   at System.Windows.Documents.AdornerDecorator.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 Telerik.Windows.Controls.GridView.GridViewDataControl.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.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.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.Grid.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 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   at System.Windows.Controls.Grid.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.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.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 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.Controls.Border.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.Border.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 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.Control.MeasureOverride(Size constraint)   at Telerik.Windows.Controls.RadTabControl.MeasureOverride(Size availableSize)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at Telerik.Windows.Controls.ProportionalStackPanel.MeasureOverride(Size availableSize)   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.ItemsPresenter.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.Grid.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.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 Telerik.Windows.Controls.DockingPanel.MeasureOverride(Size availableSize)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at System.Windows.Controls.DockPanel.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.Grid.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 Telerik.Windows.Controls.RadDocking.MeasureOverride(Size availableSize)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   at System.Windows.Controls.Grid.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.Controls.Border.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.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)   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.Border.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.Control.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 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.Controls.Decorator.MeasureOverride(Size constraint)   at System.Windows.Documents.AdornerDecorator.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.Window.MeasureOverrideHelper(Size constraint)   at System.Windows.Window.MeasureOverride(Size availableSize)   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)   at System.Windows.UIElement.Measure(Size availableSize)   at System.Windows.ContextLayoutManager.UpdateLayout()   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)   at System.Windows.Interop.HwndTarget.OnResize()   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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)
Thanks,
yonadav

Rossen Hristov
Telerik team
 answered on 14 Jun 2012
1 answer
175 views
Hi Support,
   I'm working on a touch screen app which requires cropping to be implemented. Can u help me out how to handle the events there & to make the drag corners bigger in size.


Thank u
Selva
Iva Toteva
Telerik team
 answered on 14 Jun 2012
3 answers
251 views

Hi Telerik,

I'm currently trying to achieve functionality similar to the trackball behavior, but I actually need to display a horizontal line, that crosses the given ScatterLineSeries  and starts at the corresponding vertical axis. I have to draw a slider on that axis, so I will be able to move this line by moving the slider along the axis (I've attached an image to explain what I mean).

The problem is I can't determine the position of the vertical axis during runtime to place the slider on the correct location.

I can draw the horizontal line and intersection points using another ScatterLineSeries (as was done to create an attached image), but the series cannot be drawn outside the ChartArea, so I have to extend the line to an axis programmatically.

So, is it possible to get the Y-axis coordinates inside the ChartView, or is there another way to implement the described scenario?

Thanks in advance.

Petar Marchev
Telerik team
 answered on 14 Jun 2012
1 answer
128 views
In my application the ItemsSource for the listbox will change depeding on other entity values. I am using CollectionViewSource with changing filter to implement this.

However, the SelectedItem binding is lost in this case. WPF standard ListBox on the other hand behaves correctly. You can download demo application here: http://jemerald.com/myfiles/ListBoxWithFilterSource.rar
Georgi
Telerik team
 answered on 14 Jun 2012
2 answers
142 views
Hi,
I need to show a custom appointment with some custom fields, I followed docs samples but it doesn't work.

My steps:
1) create an AppointmentExt class that inherits from Appointment, with 2 simple extra fields
public class AppointmentExt : Appointment
{
    public planning_slot Slot { get; set; }
    public string SpecialTooltip { get; set; }
}

2) added an ObservableCollection<AppointmentExt> as Appointments source
ObservableCollection<AppointmentExt> appointments = new ObservableCollection<AppointmentExt>();

3) Created a new Tooltip template and bind the text to my specialtooltip
<DataTemplate x:Key="ScheduleTooltip">
    <StackPanel Orientation="Horizontal">
        <TextBlock MaxWidth="200" TextWrapping="Wrap" Text="{Binding SpecialTooltip}"/>
    </StackPanel>
</DataTemplate>

At runtime the SpecialTooltip is fill but it's displayed empty (not binded?).

So I've 2 question:
A) how can I bind the tooltip to my SpecialTooltip field?
B) how can I change the way the appointment is draw ?

Thanks


Yana
Telerik team
 answered on 14 Jun 2012
1 answer
168 views
We are creating a linear gauge, it needs to show some extra markers (on-demand based on user's setting, binding to "Markers").
We tried to add <telerik:LinearScale.CustomItems>, but we can not set up the databinding... and we tried to add
CustomItems="{Binding Markers}"
CustomItemTemplate="{StaticResource CustomItemTemplate}"
but we cannot make it work.

BTW: as the code shows below, the gauge shows "CurrentFrameNumber" on the top of the gauge, and we would like the extra markers appear on the bottom of the gauge.

Could you please help?
Thanks.

<telerik:RadHorizontalLinearGauge Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="TimeGauge" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="0" OuterBackground="#00000000" OuterBorderThickness="0" Background="#00000000" BorderBrush="#00000000">
                <telerik:LinearScale x:Name="TimeScale"
                                     Min="{Binding Min}"
                                     Max="{Binding Max}"
                                     IsInteractive="True"
                                     RelativeX="0.04"
                                     RelativeWidth="0.92" RelativeY="0.6"
                                     FontSize="10"
                                     Fill="#4D0000F9"
                                     CustomItems="{Binding Markers}"
                                     CustomItemTemplate="{StaticResource CustomItemTemplate}">
                    <telerik:LinearScale.Indicators>
                        <telerik:BarIndicator x:Name="TrackBar"
                                              Value="{Binding CurrentFrameNumber, Mode=TwoWay}" IsAnimated="False" Background="#FF00C500" />
                        <telerik:Marker x:Name="CurrentFrameMarker"
                                        Value="{Binding CurrentFrameNumber, Mode=TwoWay}"
                                        telerik:ScaleObject.Offset="0.10"
                                        telerik:LinearScale.RotateForVertical="True"
                                        telerik:ScaleObject.RelativeWidth="0.04"
                                        telerik:ScaleObject.RelativeHeight="0.30"
                                        telerik:ScaleObject.Location="Outside">
                            <telerik:Marker.Template>
                                <ControlTemplate TargetType="{x:Type telerik:Marker}">
                                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                        <Polygon Points="0,0 0,0.7 0.5,1 1,0.7 1,0"
                                                 Stretch="Fill"
                                                 Fill="Yellow"
                                                 Stroke="Green"
                                                 StrokeThickness="2" />
                                    </Grid>
                                </ControlTemplate>
                            </telerik:Marker.Template>
                        </telerik:Marker>
                    </telerik:LinearScale.Indicators>
                </telerik:LinearScale>
            </telerik:RadHorizontalLinearGauge>
Andrey
Telerik team
 answered on 14 Jun 2012
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?