Telerik Forums
UI for WPF Forum
3 answers
330 views

Hi, I have a radRichTextBox, and when I click on an image the ImageMiniToolBar appears but it has nondescript tooltips like System.Windows.Controls.TextBlock. Is there a way to specify each button tooltip?   

Tanya
Telerik team
 answered on 24 Jan 2020
0 answers
222 views

Hi,

DragDropManager.AddDropHandler not working for ItemsControl,

Here is my code. I also attached a sample project.

VIEW

<Window x:Class="DragDropExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="500"
        Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Vertical"
                    Margin="10">
            <TextBlock Text="SOURCE"
                       FontWeight="Bold" />

            <ItemsControl Name="Source"
                          VerticalAlignment="Stretch"
                          Height="400"
                          BorderBrush="Red"
                          BorderThickness="1">
                
                <Button  Content="DRAG ME"
                         Margin="10"
                         Width="100"
                         telerik:DragDropManager.AllowCapturedDrag="True" />

                <Button  Content="DRAG ME 1"
                         Margin="10"
                         Width="100"
                         telerik:DragDropManager.AllowCapturedDrag="True" />
            </ItemsControl>
        </StackPanel>

        <StackPanel  Grid.Column="1"
                     Margin="10"
                     Orientation="Vertical">
            <TextBlock Text="This is ItemsControl. NOT WORKING"
                       FontWeight="Bold" />
            <ItemsControl    Name="TargetItemsControl"
                             AllowDrop="True"
                             Height="400"
                             BorderBrush="Blue"
                             BorderThickness="1"
                             VerticalAlignment="Stretch" />
        </StackPanel>

        <StackPanel Grid.Column="2"
                    Margin="10"
                    Orientation="Vertical">
            <TextBlock Text="This is LlistBox. WORKING"
                       FontWeight="Bold" />

            <ListBox    Name="TargetListBox"
                        AllowDrop="True"
                        Height="400"
                        VerticalAlignment="Stretch"
                        BorderBrush="Blue"
                        BorderThickness="1"
                        Grid.Column="2" />
        </StackPanel>

    </Grid>
</Window>

 

CODE

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Telerik.Windows.DragDrop;

namespace DragDropExample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DragDropManager.AddDragInitializeHandler(Source, OnDragInitialize);
            DragDropManager.AddGiveFeedbackHandler(Source, OnGiveFeedback);
            DragDropManager.AddDropHandler(TargetItemsControl, OnDrop);
            DragDropManager.AddDropHandler(TargetListBox, OnDrop);
        }
        private void OnDragInitialize(object sender, DragInitializeEventArgs args)
        {
            FrameworkElement source = sender as FrameworkElement;

            args.AllowedEffects = DragDropEffects.All;
            var payload = DragDropPayloadManager.GeneratePayload(null);
            var data = ((Button)args.OriginalSource).Content;
            payload.SetData("DragData", data);
            args.Data = payload;
            args.DragVisual = new ContentControl { Content = data };
        }

        private void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs args)
        {
            args.SetCursor(Cursors.Arrow);
            args.Handled = true;
        }

        private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        {
            var data = ((DataObject)e.Data).GetData("DragData") as string;

            if (sender.GetType() == typeof(ListBox))
            {
                TargetListBox.Items.Add(data);
            }
            else if (sender.GetType() == typeof(ItemsControl))
            {
                TargetItemsControl.Items.Add(data);
            }
        }
    }
}



Yesim
Top achievements
Rank 1
 asked on 24 Jan 2020
3 answers
161 views

According to your article:

https://docs.telerik.com/devtools/wpf/controls/radgridview/features/search-as-you-type#modifying-the-searching-criteria

 

E.g. I want to search for RIO + CED but the "+" operator is not working. Please see attached pic (plus.jpg)!

Or how can I check that the system is set up well?

I tried already to change the culture code from the UIThread because we use it to change localization, no change.

 

By the way the quotes operator is working.(quotes.jpg) 

 

Use telerik 2018.2.515.45

 

Thanks for your help!!

PR Gert

 

Gert
Top achievements
Rank 1
 answered on 24 Jan 2020
5 answers
80 views

Hello,

I have a WPF project where I am using RadDocking with 3 RadPaneGroups. I get an Index out of range error when I pin and then try to unpin a pane or if I try to pin a second item. I am able to set the pane to floatable/dockable and manipulate them that way, but when I try to unpin I get the error. I'd like to note we are targeting framework .Net Core 3.1.

Error Message:

System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')'

This exception was originally thrown at this call stack:
System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
Telerik.Windows.Controls.RadTabControl.RaiseIsSelectedChangedAutomationEvent(System.Windows.DependencyObject, bool)
Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(bool, bool)
Telerik.Windows.Controls.RadTabItem.OnIsSelectedPropertyChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, ref System.Windows.EffectiveValueEntry, bool, bool, System.Windows.OperationType)
System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty, object, System.Windows.PropertyMetadata, bool, bool, System.Windows.OperationType, bool)
    ...
    [Call Stack Truncated]

Here is my XAML:

01.<telerik:RadDocking Grid.Row="3" BorderThickness="0" HasDocumentHost="False" RetainPaneSizeMode="DockingAndFloating" CanAutoHideAreaExceedScreen="True">
02.            <telerik:RadSplitContainer Orientation="Horizontal">
03.                <!--My Queries-->
04.                <telerik:RadPaneGroup>
05.                    <telerik:RadPane Header="My Queries" CanUserClose="True"  >
06.                        <StackPanel>
07.                            <Border>
08.                                <StackPanel>
09.                                    <TextBlock Text="Query Results" />
10.                                </StackPanel>
11.                            </Border>
12.                        </StackPanel>
13.                    </telerik:RadPane>
14.                </telerik:RadPaneGroup>
15. 
16.                <!--Summary-->
17.                <telerik:RadPaneGroup>
18.                    <telerik:RadPane Header="Summary" CanUserClose="True" >
19.                        <StackPanel Margin="3">
20.                            <TextBlock Text="View Summary" />
21.                        </StackPanel>
22.                    </telerik:RadPane>
23.                </telerik:RadPaneGroup>
24. 
25.                <!--Torge Charts-->
26.                <telerik:RadPaneGroup>
27.                    <telerik:RadPane Header="Torque Charts" CanUserClose="True" >
28.                        <StackPanel Margin="3">
29.                            <TextBlock Text="View Torque Charts" />
30.                        </StackPanel>
31.                    </telerik:RadPane>
32.                </telerik:RadPaneGroup>
33.                 
34.            </telerik:RadSplitContainer>
35.        </telerik:RadDocking>

 

Harry
Top achievements
Rank 1
 answered on 23 Jan 2020
1 answer
81 views

Hi all!

I have an event which triggers an async loading task in which I change data which is bound to the RadCalendar.

In my development environment I never had any issues but users on RDS-Server have. This is the stack-trace from there log: 

 

ERROR2020-01-20 11:25:28 – Fatal Error - StackTrace: ModuleContainerManager - HandleUnhandledException

WeakReferenceList`1 - IndexOf

WeakReferenceList`1 - Remove

SelectionChanger`1 - Select

SelectionChanger`1 - InsertItem

Collection`1 - Add

SelectionChanger`1 - AddJustThis

RadCalendar - AddToSelection

RadCalendar - OnSelectedDateChanged

RadCalendar - OnSelectedDateChanged

DependencyObject - OnPropertyChanged

FrameworkElement - OnPropertyChanged

DependencyObject - NotifyPropertyChange

DependencyObject - UpdateEffectiveValue

DependencyObject - InvalidateProperty

BindingExpressionBase - Invalidate

BindingExpression - TransferValue

BindingExpression - ScheduleTransfer

ClrBindingWorker - NewValueAvailable

PropertyPathWorker - UpdateSourceValueState

PropertyPathWorker - OnDependencyPropertyChanged

ClrBindingWorker - OnSourceInvalidation

BindingExpression - HandlePropertyInvalidation

BindingExpressionBase - OnPropertyInvalidation

BindingExpression - OnPropertyInvalidation

DependentList - InvalidateDependents

DependencyObject - NotifyPropertyChange

DependencyObject - UpdateEffectiveValue

DependencyObject - SetValueCommon

DependencyObject - SetCurrentValue

RadDateTimePicker - OnSelectedValueChanged

RadDateTimePicker - OnSelectedValueChanged

DependencyObject - OnPropertyChanged

FrameworkElement - OnPropertyChanged

DependencyObject - NotifyPropertyChange

DependencyObject - UpdateEffectiveValue

DependencyObject - InvalidateProperty

BindingExpressionBase - Invalidate

BindingExpression - TransferValue

BindingExpression - ScheduleTransfer

ClrBindingWorker - NewValueAvailable

PropertyPathWorker - UpdateSourceValueState

PropertyPathWorker - RefreshValue

ClrBindingWorker - ScheduleTransferOperation

DataBindOperation - Invoke

DataBindEngine - ProcessCrossThreadRequests

ExceptionWrapper - InternalRealCall

ExceptionWrapper - TryCatchWhen

DispatcherOperation - InvokeImpl

DispatcherOperation - InvokeInSecurityContext

CulturePreservingExecutionContext - CallbackWrapper

ExecutionContext - RunInternal

ExecutionContext - Run

ExecutionContext - Run

CulturePreservingExecutionContext - Run

DispatcherOperation - Invoke

Dispatcher - ProcessQueue

Dispatcher - WndProcHook

HwndWrapper - WndProc

HwndSubclass - DispatcherCallbackOperation

ExceptionWrapper - InternalRealCall

ExceptionWrapper - TryCatchWhen

Dispatcher - LegacyInvokeImpl

HwndSubclass - SubclassWndProc

nsafeNativeMethods - DispatchMessage

Dispatcher - PushFrameImpl

Dispatcher - PushFrame

Application - RunDispatcher

Application - RunInternal

Application - Run

Application - Run

App - Main

 

Do I have to take care some how of the binding or how can I catch this to prevent app crash?

Thanks for help!!!!!!

BR Gert

Martin Ivanov
Telerik team
 answered on 23 Jan 2020
1 answer
242 views

Hello!

I have ran into one unwanted behavior of RadScheduleView. I have a RadScheduleView on my view form, horizontal TimeRuler and vertical grouped recources like a rows. When I move mouse cursor below last resource row I get the slot above mouse cursor selected. Is there a way to allow only select slots when mouse cursor directrly over the slot.

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Jan 2020
4 answers
321 views

Hi there,

When I try to add help content to MS Help Viewer 2.3 I get a error message:  For security reason DTD is prohibited in this XML document...

For full detail see attached screenshot. 

And my question is what can I do on my side to add WPF Help File content to my help viewer?

Bill
Top achievements
Rank 1
 answered on 21 Jan 2020
1 answer
663 views

I created a custom splashscreen usercontrol with a custom viewmodel (as explained in the docs) but when i try to update the values on the viewmodel only the original values are shown and the new values are ignored? how is this possible?

If i used the standard splashscreen it works

Vladimir Stoyanov
Telerik team
 answered on 21 Jan 2020
2 answers
492 views
I am trying to figure out how to replace the copy command with my own version that can copy the row/column headers, as well as prevent cut and paste. In other controls I handled PreviewCanExecute and PreviewExecuted, but those don't seem to get triggered here. I tried to replace the editor.Commands.Copy command but it is readonly. Same with the command descriptors.
Prashant
Top achievements
Rank 1
 answered on 21 Jan 2020
4 answers
342 views

Hi,

I'm just beginning with the syntax editor, so am using a simple test project with nothing but a RadSyntaxEditor in a MainWindow.

I am using the separate NuGet packages (version 2020.1.115) with implicit styles (Fluent theme).

What I find is that even with nothing else, I get an error from my App.xaml file saying "Cannot find resource named 'DragVisualStyle'. Resource names are case sensitive." This doesn't seem to prevent the project from building and running, but still it is an error that shows in the error list and I seem to be unable to get rid of it.

After a small amount of investigation, it does seem that the resource dictionary for the SyntaxEditor (at least for the Fluent theme, but maybe others) is referencing the DragVisualStyle without defining it. Looking at some of the other controls it seems that they do each redefine that style if they need it, so the SyntaxEditor seems to differ in that respect.

I wanted to attach a simple example solution, but can't attach .zip files, so basically reproducing this amounts to creating a new WPF project, adding PackageReferences to the SyntaxEditor and Fluent theme NuGet packages, then merging the following in App.xaml:

    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.SyntaxEditor.xaml" />

And having the following in MainWindow.xaml:

    <telerik:RadSyntaxEditor/>

Thanks

Adam
Top achievements
Rank 1
 answered on 21 Jan 2020
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
FileDialogs
Book
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?