Telerik Forums
UI for WPF Forum
1 answer
150 views
Hi,

i created a custom shape with a special datatemplate.

RadDiagramShape StateBox = new RadDiagramShape()
{                                               
    Content = model,
     Height = 80,
     Width = 150,
     ContentTemplate = (DataTemplate)this.FindResource("SubItemTemplate"),
     Position = e.GetPosition((RadDiagram)sender),
     Geometry = droppedSwitch.Geometry,    
      IsResizingEnabled = false                           
};

DataTemplate xaml:
<DataTemplate x:Key="SubItemTemplate">
      <Grid Background="Transparent" Width="{Binding Width, Mode=TwoWay}" Height="{Binding Height, Mode=TwoWay}">    
           <TextBlock Text="{Binding SN}" x:Name="PartID" />
       </Grid>
</DataTemplate>

This works fine. But how do i add a "BeginEdit" Method to the CustomShape? Thanks so far

Best Regards
Rene
Martin Ivanov
Telerik team
 answered on 07 Apr 2014
1 answer
169 views
My application's main window is a  RadRibbonWindow that hosts a RadRibbonView. When clicking on a button another RadRibbonWindow is being opened.
When I'm testing this program on my machine everything works fine. When I'm testing on a remote machine via RDP the control Buttons (minimize/maximize/close) disappear.

I've attached a a screenshot.

App.xaml:
<Application x:Class="TelerikRibbonView.App"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
    </Application.Resources>
</Application>


MainWindow.xaml
<telerik:RadRibbonWindow x:Class="TelerikRibbonView.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
 
        <telerik:RadRibbonView />
        <telerik:RadButton Grid.Row="1" Width="80" Height="30" Margin="5" Click="RadButton_Click">Click me</telerik:RadButton>
    </Grid>
</telerik:RadRibbonWindow>




MainWindow.cs:
using System.Windows;
using Telerik.Windows.Controls;
 
namespace TelerikRibbonView
{
   public partial class MainWindow : RadRibbonWindow
   {
      public MainWindow()
      {
         InitializeComponent();
      }
 
      private void RadButton_Click(object sender, RoutedEventArgs e)
      {
         MainWindow secondWnd = new MainWindow();
         secondWnd.Show();
      }
   }
}


Michael


​
Martin Ivanov
Telerik team
 answered on 07 Apr 2014
1 answer
120 views
Hello,

I have successfully bound a list of items to a RadListBox ItemSource, and bound to one column as a RadPropertyGrid. The other column, we want to appear as RadChart, somehow binding to a data series. The underlying model is in the form of List Pair of TimeSpan and Double. Possibly we directly bind to this, or at least Path-ing our way into the domain model, i.e. TotalSeconds, TotalMilliseconds, etc.

Doable?

Possibly I could start with programmatically doing it, but I'd like to go the XAML route and data bind if I could. Have worked with more than one chart in this manner before.

Thank ye...

Best regards,
Petar Marchev
Telerik team
 answered on 07 Apr 2014
1 answer
146 views
Hi,

Is it possible to use SigralR as datasource with GridView?

My case is that the same database is used in my WPF application and in my web. My idea was that SignalR is used for propagating changes done in other ends. (add, delete and moved rows by drag-drop)

I was inspired by this great Kendo example:  http://demos.telerik.com/kendo-ui/web/grid/signalr.html
Nick
Telerik team
 answered on 07 Apr 2014
2 answers
150 views
Hi,
I have a RadPaneGroup where I want to add the items on a button click.
So:

<telerik:RadDocking.DocumentHost>
 <telerik:RadSplitContainer>
  <telerik:RadPaneGroup ItemsSource="{Binding RecordItems}">
   <telerik:RadPaneGroup.ContentTemplate>
    <DataTemplate>
     <views:RecordTabView DataContext="{Binding}"/>
    </DataTemplate>
   </telerik:RadPaneGroup.ContentTemplate>
   <telerik:RadPaneGroup.ItemTemplate>
    <DataTemplate>
     <TextBlock Text="{Binding Title}"/>
    </DataTemplate>
   </telerik:RadPaneGroup.ItemTemplate>
  </telerik:RadPaneGroup>
 </telerik:RadSplitContainer>
</telerik:RadDocking.DocumentHost>


On button click I add a new RecordTabViewModel to the collection.
This works perfect the content and the header are displayed correctly.
But an error occurs when I want to switch between the Tabs:

System.NullReferenceException wurde nicht behandelt.
  HResult=-2147467261
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       bei Telerik.Windows.Controls.RadPane.OnHeaderMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.EventRoute.ReInvokeHandlers(Object source, RoutedEventArgs args)
       bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       bei System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
       bei System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.Run()
       bei System.Windows.Application.RunDispatcher(Object ignore)
       bei System.Windows.Application.RunInternal(Window window)
       bei System.Windows.Application.Run(Window window)
       bei System.Windows.Application.Run()
       bei EtaStudio.App.Main() in d:\Firma\Projekte\Visual Studio\Visual Studio 2013\Projects\EtaSoftware\EtaStudio\obj\x86\Debug\App.g.cs:Zeile 0.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Regards Markus

Klemens
Top achievements
Rank 1
 answered on 07 Apr 2014
3 answers
115 views
Whilst working with the telerik property grid for wpf, I realised that it automatically implemented an undo/redo command on each property in the property grid. I was wondering if there was a way I could bind this command to say a button that could be clicked for usability's sake (not individually, but for the grid as a whole).

Thanks very much in advance!
Dimitrina
Telerik team
 answered on 04 Apr 2014
1 answer
87 views
Is it possible to add scroll bars to the mail merge field drop-down box? Our mail merge source can have 15+ fields in it. When a user is editing RTB content and clicks the Insert Merge Field button the list pops up but half the fields are not visible and there's no way to scroll the list. Does this require handling the insert command and customizing the drop-down? Even turning on CanVerticallyScroll doesn't seem to help.

Steve
Steven
Top achievements
Rank 1
 answered on 04 Apr 2014
5 answers
222 views
No matter which value I use for TabStripPlacement, it's drawn at the top.  Why?

Sample:

<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    x:Class="Testing" 
    x:Name="Window" 
    Title="Workspace" 
    Width="640" Height="480"
 
    <DockPanel x:Name="LayoutRoot"
        <telerikDocking:RadDocking> 
            <telerikDocking:RadDocking.DocumentHost> 
                <telerikDocking:RadSplitContainer> 
                    <telerikDocking:RadPaneGroup TabOrientation="Horizontal" TabStripPlacement="Bottom">                     
                        <telerikDocking:RadPane x:Name="Case000001Pane" Header="CR000001" CanFloat="False" CanUserPin="True"
                            <TextBlock FontSize="18.667" Text="Case 000001" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/> 
                        </telerikDocking:RadPane> 
                        <telerikDocking:RadPane x:Name="Case000002Pane" Header="CR000002" CanFloat="False" CanUserPin="True"
                            <TextBlock FontSize="18.667" Text="Case 000002" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/> 
                        </telerikDocking:RadPane> 
                        <telerikDocking:RadPane x:Name="Case000003Pane" Header="CR000003" CanFloat="False" CanUserPin="True"
                            <TextBlock FontSize="18.667" Text="Case 000003" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/> 
                        </telerikDocking:RadPane> 
                        <telerikDocking:RadPane x:Name="Case000004Pane" Header="CR000004" CanFloat="False" CanUserPin="True"
                            <TextBlock FontSize="18.667" Text="Case 000004" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/> 
                        </telerikDocking:RadPane> 
                    </telerikDocking:RadPaneGroup> 
                </telerikDocking:RadSplitContainer> 
            </telerikDocking:RadDocking.DocumentHost> 
        </telerikDocking:RadDocking> 
    </DockPanel> 
</Window> 

Kalin
Telerik team
 answered on 04 Apr 2014
2 answers
404 views
Code:

<UserControl.Resources>
<ResourceDictionary>
<ControlTemplate x:Key="RadTreeViewItemControlTemplate1" TargetType="{x:Type telerik:RadTreeViewItem}">
<Grid x:Name="RootElement">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid x:Name="HeaderRow" Background="Transparent" MinHeight="{TemplateBinding MinHeight}" SnapsToDevicePixels="True">
<Border x:Name="SelectionUnfocusedVisual" BorderBrush="#FFDBDBDB" BorderThickness="1" Grid.ColumnSpan="6" Grid.Column="2" CornerRadius="1" Visibility="Collapsed">
<Border BorderBrush="Transparent" BorderThickness="1" CornerRadius="0">
<Border.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#FFF8F6F9" Offset="0"/>
<GradientStop Color="#FFF0F0F0" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</Border>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsSelectionActive" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="SelectionUnfocusedVisual" Value="Visible"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ResourceDictionary>
</UserControl.Resources>


<DockPanel>
<telerik:RadDocking x:Name="radDocking" Width="245" ConstraintAutoHideArea="False">
<telerik:RadSplitContainer x:Name="radSplitContainer">
<telerik:RadPaneGroup x:Name="radGroup">
<telerik:RadPane x:Name="radPane1" Header="Test" ContextMenuTemplate="{x:Null}" CanUserClose="False" CanFloat="False" Cursor="Hand">
<Grid>
<DockPanel LastChildFill="True">
<telerik:RadTreeView x:Name="radTreeView" DockPanel.Dock="Left" Background="#FF525152" VirtualizingPanel.IsVirtualizing="True">
<telerik:RadTreeView.Resources>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<Setter Property="Template" Value="{StaticResource RadTreeViewItemControlTemplate1}" />
</Style>
</telerik:RadTreeView.Resources>
</telerik:RadTreeView>
</DockPanel>
</Grid>
</telerik:RadPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
</telerik:RadDocking>
</DockPanel>A

After using the Radpane, the selected item is not having the style applied. If RadTreeView alone is used (without having radpane), the selected item in the radtreeview is having the style SelectionUnfocusedVisual which is working properly (i.e), Selected Item gets Highlighted. How to make the selected item in the radtreeview to have a style applied (or) to highlight the radtreeview selected item when a radpane is used?. Thanks.
John
Top achievements
Rank 1
 answered on 04 Apr 2014
2 answers
309 views
I posted a thread two days ago about a problem I was having with e.Handled in a RadDocking.Close event.  After looking at the code, I moved the logic to the PreviewClose event; however the result is the same.  I am attempting to close all the panes in a RadPaneGroup inside the DocumentHost.   I have tried...
  • RadPaneGroup.HideAllPanes(), but the panes remain visible.  After the call I can close all but the first pane indiviually using the close button on each tab.  If I drag the last remaining pane off the tabstrip it disappears.
  • Any direct manipulation of the RadPaneGroup.Items, whether a call to Clear(), Remove(pane), RemoveAt(index) causes an n "Object reference not set to an instance of an object." exception after exiting the handler with e.Handled set to true.
    • at Telerik.Windows.Controls.RadPane.Close() in c:\TB\105WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1360
         at Telerik.Windows.Controls.RadPane.OnIsHiddenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1186
  • I tried looping through the Items and using RemoveFromParent() but that causes an "Object reference not set to an instance of an object." exception when attempting to remove the second pane.
    • at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
      at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
      at System.Linq.Enumerable.Max(IEnumerable`1 source)
      at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__6(Double total, List`1 next) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 174
      at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
      at Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 171
      at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
      at System.Windows.UIElement.Measure(Size availableSize)
      at System.Windows.ContextLayoutManager.UpdateLayout()
      at Telerik.Windows.Controls.RadPane.OnDocumentHostTemplateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1223
  • I tried removing all but the pane passed in the event args and leaving e.Handle false, hoping Close would take care of it, but that causes an "Object reference not set to an instance of an object." exception like the previous example.
    •    at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
         at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
         at System.Linq.Enumerable.Max(IEnumerable`1 source)
         at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__6(Double total, List`1 next) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 174
         at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
         at Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 171
         at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
         at System.Windows.UIElement.Measure(Size availableSize)
         at System.Windows.ContextLayoutManager.UpdateLayout()
         at Telerik.Windows.Controls.RadPane.OnDocumentHostTemplateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1223

All of this happens in 2012.2.620 and did not happen in 2012.2.607.  Please let me know if there is a way to achieve this functionality without having to revert to using the previous version.

Thanks in advance, Steve

Charles
Top achievements
Rank 1
 answered on 04 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?