Telerik Forums
UI for WPF Forum
1 answer
155 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
192 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
201 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
143 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
129 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
267 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
452 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
391 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
8 answers
1.2K+ views
I have rad windows ,one of them is mainwindow  ,another of them is show dialog window  and  i have problem about, for example .both of them opened and  when i would open different program after that  trying to open again this program window of show dialog  stay back side  and i  and i cant be usefull for me  in a result i want show dialog window is top of main window also i tried to use  named BringIntoView and BringIntofront methods but they didnt work. i need your helps. maybe you can send sample about it to me,
Kalin
Telerik team
 answered on 04 Apr 2014
2 answers
93 views
Hello,

I already implemented some drag and drop behaviors in my application. To do so, I create a DragVisual in the OnDragInitialize event (registered via DragDropManager.AddDragInitializeHandler), and I give it a DataContext (a Content actually) and a ContentTemplate. Then I can have a nice preview of the data being dragged that I can template as I wish and that will follow the mouse cursor.
This work perfectly when I'm dragging data from my app, to my app.

Now I am willing to be able to drag files, from the windows explorer, to a specific control of my application. I would like to create a DragVisual in the same way, when the mouse cursor enters one of the windows of my application (and destroy it if the mouse cursor leaves the window, but this is another problem).

The problem is that when the drag starts from another application, OnDragInitialize is not invoked (which makes perfectly sense). But how can I achieve to create a DragVisual in this context? None of the other drag'n'drop-related events have a DragVisual in their EventArgs.

Thanks
Administrator
Telerik team
 answered on 04 Apr 2014
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?