Telerik Forums
UI for WPF Forum
1 answer
90 views
Docking Error


Kalin
Telerik team
 answered on 27 Jan 2015
4 answers
346 views
Hello,

I'm using telerik 2012 for WPF (Telerik.Windows.Controls.GridView.dll file version is 2012.3.1129.40).

I've defined grouping for a RadGridView, and set the AutoExpandGroups property to True.

When the Grid is opened, the groups are expanded, yet an empty area appears below the grid, and disappears only after I collapse and expand again one of the groups.

Please see the attached screenshot.

Thanks,
Guy E.
Guy
Top achievements
Rank 1
 answered on 27 Jan 2015
4 answers
348 views
I am attemtping to have my application switch from a default theme of Visual Studio 2013 Dark to the Windows 8 Touch during runtime. The Visual Studio theme applies correctly but when I attempt to switch the theme dynamically to the Touch theme I get the following error: Cannot find resource named 'ButtonIconForeground_MouseOver'. Resource names are case sensitive. I understand what the error is but I don't understand why it is happening. I am using the following Telerik DLLs:

Telerik.Windows.Controls
Telerik.Windows.Controls.Data
Telerik.Windows.Controls.Docking
Telerik.Windows.Controls.Navigation
Telerik.Windows.Controls.Input
Telerik.Windows.Data

This is my code to apply the default Visual Studio 2013 Dark theme:
<Application x:Class="Mantis.Client.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:resources="clr-namespace:Mantis.Client.Resources"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Application.Resources>
        <ResourceDictionary>
            <!--These theme resources are here as defaults-->
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/VisualStudio/System.Windows.xaml" />
                <ResourceDictionary Source="/Themes/VisualStudio/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Themes/VisualStudio/Telerik.Windows.Controls.Data.xaml" />
                <ResourceDictionary Source="/Themes/VisualStudio/Telerik.Windows.Controls.Docking.xaml" />
                <ResourceDictionary Source="/Themes/VisualStudio/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Themes/VisualStudio/Telerik.Windows.Controls.Navigation.xaml" />
            </ResourceDictionary.MergedDictionaries>
 
            <HierarchicalDataTemplate x:Key="MenuItemTemplate"
                                      ItemsSource="{Binding Items}">
                <TextBlock Text="{Binding Text}" />
            </HierarchicalDataTemplate>
 
            <Style x:Key="MenuStyle"
                   TargetType="telerik:RadMenuItem"
                   BasedOn="{StaticResource RadMenuItemStyle}">
                <Setter Property="IsCheckable"
                        Value="{Binding IsCheckable}" />
                <Setter Property="IsChecked"
                        Value="{Binding IsChecked, Mode=TwoWay}" />
                <Setter Property="IsSeparator"
                        Value="{Binding IsSeparator}" />
                <Setter Property="IsEnabled"
                        Value="{Binding IsEnabled}" />
                <Setter Property="StaysOpenOnClick"
                        Value="{Binding StaysOpenOnClick}" />
                <Setter Property="Icon"
                        Value="{Binding Image}" />
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>

public partial class App : Application
    {
        private MantisBootstrapper _bootstrapper;
 
        protected override void OnStartup(StartupEventArgs e)
        {
            Telerik.Windows.Controls.VisualStudio2013Palette.LoadPreset(Telerik.Windows.Controls.VisualStudio2013Palette.ColorVariation.Dark);
 
            base.OnStartup(e);
 
            this._bootstrapper = new MantisBootstrapper();
            this._bootstrapper.Run();
        }
 
        protected override void OnExit(ExitEventArgs e)
        {
            this._bootstrapper.Shutdown();
 
            base.OnExit(e);
        }
    }

Here is where I apply the Windows 8 Touch theme:
private void RadMenuItem_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            App.Current.Resources.MergedDictionaries.Clear();
 
            App.Current.Resources.MergedDictionaries.Add(new Telerik.Windows.Controls.Windows8TouchResourceDictionary());
 
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/System.Windows.xaml", UriKind.Relative) });
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/Telerik.Windows.Controls.xaml", UriKind.Relative) });
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/Telerik.Windows.Controls.Data.xaml", UriKind.Relative) });
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/Telerik.Windows.Controls.Docking.xaml", UriKind.Relative) });
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/Telerik.Windows.Controls.Input.xaml", UriKind.Relative) });
            App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Themes/Touch/Telerik.Windows.Controls.Navigation.xaml", UriKind.Relative) });
        }

Eric
Top achievements
Rank 1
 answered on 26 Jan 2015
2 answers
156 views
Hi,

Sometimes when copy and paste diagram items, I get error says "An item with the same key has already been added."

Here is the call stack
==========================================================================================

System.ArgumentException was unhandled
  HResult=-2147024809
  Message=An item with the same key has already been added.
  Source=mscorlib
  StackTrace:
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Telerik.Windows.Diagrams.Core.SerializationService.DeserializeItems(SerializationInfo serializationInfo, Boolean makeUnique)
       at Telerik.Windows.Controls.Diagrams.DataTransferService.HandleDiagramElementDrop(DataObject dataObject)
       at Telerik.Windows.Controls.Diagrams.DataTransferService.HandlePaste(DataObject dataObject, Action`1 action)
       at Telerik.Windows.Controls.RadDiagram.Paste()
       at Telerik.Windows.Controls.RadDiagram.OnPasteCommandExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
       at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
       at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
       at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
       at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
       at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run()

========================================================

Thanks,

Ahmed
Ahmed
Top achievements
Rank 1
 answered on 26 Jan 2015
2 answers
312 views
We have a RadPropertyGrid with its items being auto-generated.

How can I set Tooltips to the labels and/or to the editors being generated???

Tooltips should be set inside auto-generation 
Maurizio
Top achievements
Rank 2
 answered on 26 Jan 2015
1 answer
95 views
If RadGridView has vertical scroll bar and I tab out the scroll viewer scrolls on its own.

I have 1 gridView and 2 buttons, I select a row on gridview and then hit tab,  the focus is on the button but the grid automatically scrolls.

<Grid DataContext="{StaticResource MyViewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <telerik:RadGridView Name="playersGrid" 
ItemsSource="{Binding Players}" 
AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" TabStopMode="Skip"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Number}" TabStopMode="Skip"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Position}" TabStopMode="Skip"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}" TabStopMode="Skip"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <telerik:RadButton Name="Button1"
  Content="ScrollIntoView" 
  Click="Button1_Click"
  Margin="5"
  HorizontalAlignment="Left"/>
            <telerik:RadButton Name="Button2"
  Content="BringIndexIntoView" 
  Click="Button2_Click"
  Margin="5"
  HorizontalAlignment="Left"/>
        </StackPanel>
    </Grid>
Boris
Telerik team
 answered on 26 Jan 2015
3 answers
239 views
I am using the newest version of telerik libraries, but on my ChartView controls are null values displayed as 0s so on LineChart lines are there evry time pointing to 0 where null value is avaiulable.

Is this the way it is supposed to work ? DoI have to use old version of Chart (RadChart) to have empty (null) vales properly displayed ?

Cheers,
Robert
Petar Marchev
Telerik team
 answered on 26 Jan 2015
9 answers
127 views

There are descriptors for Categorical, Scatter, and Polar. What about for RangeSeries?


Thanks - Mitch

Martin Ivanov
Telerik team
 answered on 26 Jan 2015
3 answers
86 views
Hi,

I want to use the default drag/no-drag cursors on the RadTreeListView control to keep it consistent with other controls. However I see that RadTreeListView implements OnGiveFeedback event and always sets the cursor to an 'Arrow' and also sets e.Handled to true. Firstly, the cursor here should be set based on DragDropEffects and should not be forced to Arrow. Secondly, e.Handled should not be set to true as one can never add a handler the OnGiveFeedback event which I can use to change the arrow. Attached is a screenshot..

RadTreeListView.cs
private void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs e)
  {
    e.SetCursor(Cursors.Arrow);
    e.Handled = true;
    if (e.Effects != DragDropEffects.None)
      return;
    this.OnDropImpossible(this.CurrentDragVisual);
  }
Nick
Telerik team
 answered on 24 Jan 2015
5 answers
313 views
Hi,

we want to bind a RadGridView to a collection of objects that implement DynamicObject. However, we don't want to bind to the dynamic properties, but only classical properties (e.g. the Name property in the following example).

public class MyDynamicObject : DynamicObject
{
    public string Name { get; set; }
 
    public override bool TryGetMember(GetMemberBinder binder, out object result)
    {
        return base.TryGetMember(binder, out result);
    }
 
    public override bool TrySetMember(SetMemberBinder binder, object value)
    {
        return base.TrySetMember(binder, value);
    }
}

However, the RadGridView only tries to bind to the dynamic members and throws exceptions if the dynamic member is not found. It does not even check if there is a normal property with the same name. This affects not only binding, but also sorting, grouping and filtering.
The typical behavior in WPF (e.g. when using a binding) and C# (when using the dynamic keyword) is to check for normal properties first! This should be the same in the RadGridView.

Alex
Ivan Ivanov
Telerik team
 answered on 24 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?