Telerik Forums
UI for WPF Forum
1 answer
858 views

Hello.

I would like to ask about the Check All function in using listbox.
I usually leave Check All aside.
But when I looked at the sample of ASP.NET (Teleik), I saw that they were tied together.

Is this even possible in WPF? What conditions are required for that?

 

Thanks.

Dilyan Traykov
Telerik team
 answered on 03 Aug 2021
1 answer
167 views

My app uses the XAML binaries and the theme manager to set the application wide theme to Windows8Touch.  I also set custom palette colors at the same time. 

But whenever I want to customize a Telerik style, it seems I have to copy all of the relevant Theme XAML out of the Telerik Theme folder, replicate it in my app, and then base my styles off of that.  That's the only way that seems to work.

Because whenever  I try to base my custom style off just the type default, like this:

    <Style TargetType="{x:Type tk:RadPathButton}" BasedOn="{StaticResource {x:Type tk:RadPathButton}}">

I get weird results.  Colors don't match my the ones I set at application start times and it looks like the XAML comes from a different theme sometimes.

Is the rule that I must copy Telerik XAML in this situation or am I doing something else wrong?

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 answered on 03 Aug 2021
1 answer
543 views

In my current WPF/MVVM project, which uses package Telerik.Windows.Controls.Spreadsheet.for.Wpf.Xaml for a view, I would like to keep the ViewModel in a netstandard2.0 project. The ViewModel project references package Telerik.Documents.Spreadsheet and exposes a property of type Telerik.Windows.Documents.Spreadsheet.Model.Workbook to which the view binds in XAML.
At runtime I get (nonsensical?) XAML Binding Failures:
1. Cannot create default converter to perform 'one-way' conversions between types 
    'Telerik.Windows.Documents.Spreadsheet.Model.Workbook' and 
    'Telerik.Windows.Documents.Spreadsheet.Model.Workbook'. 
    Consider using Converter property of Binding.
 2. Value 'Telerik.Windows.Documents.Spreadsheet.Model.Workbook' (type Workbook) 
    cannot be assigned to property RadSpreadsheet.Workbook (type Workbook).
Adding an empty "no-op" System.Windows.Data.IValueConverter gets rid of those, but still an empty grid is displayed, although the ViewModel constructor prepopulates the spreadsheet.  
Note the system behaves as expected when I instead use the same code in the net5.0 project that via package Telerik.Windows.Controls.Spreadsheet.for.Wpf.Xaml references package Telerik.Windows.Documents.Spreadsheet (which also has type Model.Workbook)

If Telerik.Windows.Documents.Spreadsheet and Telerik.Documents.Spreadsheet serve different purposes, why do they have the same namespaces?
How can I have my ViewModel in netstandard2.0?

Please find a small repro attached.
In Telerik.Spreadsheet.WPF.csproj switch Property "ViewModel" between values "direct" and "indirect" to toggle between the two versions.

Dimitar
Telerik team
 answered on 03 Aug 2021
1 answer
230 views
I tried to install and use your Theme Generator Application from here: https://docs.telerik.com/devtools/wpf/styling-and-appearance/themes-suite/color-theme-generator and when I launched it, my webcam turned on. It turned off and back on as I switched between themes and then turned off again when I closed the app. I tried this multiple times to verify that it was your app that was doing this.
Stenly
Telerik team
 answered on 02 Aug 2021
1 answer
590 views
In my PropertyGrid, one of my PropertyDefinitions binds to a property that returns a custom struct.  The struct, named "Length", represents a measured length with numeric value and measurement unit tied together. 

Since this is read-only I don't want an editor template, but I do want to be able set the template that's used to show the read-only  value.  

I do have a DataTemplate all ready.  It just shows a Label and uses a MultiBinding with the Length to show some custom information. But I cannot make the PropertyDefinition use it.

I tried setting the EditorTemplate property to my DataTemplate.  It seemed to have no effect.   Unfortunately there does not appear to be any sort of ReadOnlyTemplate property.  So is there a way for me to customize the ReadOnly view?
Dilyan Traykov
Telerik team
 answered on 02 Aug 2021
1 answer
1.8K+ views

Hi,

I use a standard Wpf Checkbox inside a RadPanelBarItem. I bind the background to a dynamic color and this works well, but when the mouse is over the box the background back to white, I would like that still remains of the assigned color.
Thank you in advance
Luigi

P.S:
Here the useful part of xaml (nothing in code behind)


<DataTemplate x:Key="PanelBarSorgentiTemplate">
			<StackPanel Orientation="Horizontal"  >				
				<CheckBox Margin="10 5 5 5" VerticalAlignment="Center"
						  IsChecked="{Binding IsChecked}"
						  Background="{Binding Color, Converter={StaticResource ColorToBrush}}"
						  
						  />
				<TextBlock Text="{Binding Name}"
						   VerticalAlignment="Center" />

			</StackPanel>
		</DataTemplate>
		
<t:RadPanelBarItem Header="{DynamicResource ResourceKey={x:Static l:ResourcesKeys.StatisticheVisualizzate}}"
							   ItemsSource="{Binding TabRisultati.StatisticheVisualizzate}"
							   ItemTemplate="{StaticResource PanelBarSorgentiTemplate}"
							   Visibility="{Binding IsTabStatisticaSelected, Converter={StaticResource BoolToVis}}"
							   IsExpanded="True"/>

Dilyan Traykov
Telerik team
 answered on 02 Aug 2021
1 answer
1.8K+ views

Hello.

I am using RadImageEditor.

I'm done with the setup. It actually works too.

But when I shift + wheel, not only horizontal movement but also vertical scrolling.

I want to move only horizontal scrolling when shift is pressed.

Which part should I control?


<telerik:RadImageEditor x:Name="xImageEditor" Image="{Binding RadImage}" behaviour:HorizontalScrollViewerHelper.IsShiftWheelProperty="True" IsPanningEnabled="True"/>
<imageEditor:ZoomController ImageEditor="{Binding ElementName=xImageEditor}" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>


public static class HorizontalScrollViewerHelper
    {
        public static bool GetIsShiftWheelProperty(DependencyObject obj) => (bool)obj.GetValue(IsShiftWheelProperty);
        public static void SetIsShiftWheelProperty(DependencyObject obj, bool value) => obj.SetValue(IsShiftWheelProperty, value);

        public static readonly DependencyProperty IsShiftWheelProperty
            = DependencyProperty.RegisterAttached("IsShiftWheel",
                typeof(bool),
                typeof(HorizontalScrollViewerHelper),
                new PropertyMetadata(false, HorizontalScrollCallback));

        private static void HorizontalScrollCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var imageEditor = d as RadImageEditor;
            imageEditor.PreviewMouseWheel += ImageEditor_PreviewMouseWheel;
        }

        private static void ImageEditor_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
        {
            if (((RadImageEditor)sender).ChildrenOfType<ScrollViewer>().FirstOrDefault() is ScrollViewer scrollViewer)
            {
                if(Keyboard.Modifiers.Equals(ModifierKeys.Shift))
                {
                    if (e.Delta < 0)
                    {
                        scrollViewer.LineRight();
                    }
                    else
                    {
                        scrollViewer.LineLeft();
                    }
                    //scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + (-e.Delta / 300));
                }
            }
        }
    }

 

Thanks.

 

Martin Ivanov
Telerik team
 answered on 02 Aug 2021
0 answers
510 views

I am looking for a way to implement an endless / infinite scroll in my RadGridView.

I have only found this very outdated blog post

https://www.telerik.com/blogs/wpf-how-to-endless-scrolling-of-2mil-records-using-backgroundworker-and-linq-to-sql

I also found some endless paging approach but I do not want to page, but instead to load more and more data when users scrolls to the end of the RadGridView.

For example,

I am calling a WebService and getting items from range 0 to 10, I populate my RadGridView with those items, when the user scrolls to the end, I want to hit my WebService again and fetch items from range 10 to 20 and load those into my RadGridView (now currently holding 20 items in total), than again user scroll to end, I once again hit WebServce fetch items from range 20 to 30, load those into my RadGridView...

This cycle can be repeated till the point my WebService delivers no data from a range.

 

Looking at other technologies, this seems to be what I am looking for

https://demos.telerik.com/kendo-ui/grid/endless-scrolling-local

https://demos.telerik.com/kendo-ui/grid/endless-scrolling-remote 

Though, I would prefer a solution where the total count can be unknown, and grid just tries to get new data everytime, untill it reaches the point where no data can be delivered, instead of knowing before hand how many items there may be

Rand
Top achievements
Rank 1
Iron
 asked on 31 Jul 2021
1 answer
160 views

Hi

I'm trying to put together a diagram sample. I based it on this: https://www.telerik.com/forums/issue-in-copy-and-paste-diagram-items as the report was about a stack trace similar to the one I'm experiencing and trying to track down: 

System.ArgumentNullException
  HResult=0x80004003
  Message=Value cannot be null.
Parameter name: dataObject
  Source=Telerik.Windows.Controls.Diagrams
  StackTrace:
	at Telerik.Windows.Controls.Diagrams.DataTransferService.HandleDiagramElementDrop(DataObject dataObject)

It builds fine but when I run it, I get an empty window, even if I click on the launch button. I can see no errors at runtime. I've attached a ZIP file of the project.

Stenly
Telerik team
 answered on 30 Jul 2021
1 answer
607 views

Hi,

 

I'm developing an application that will support scripting in it, so SyntaxEditor seems to be the perfect control to allow users to write there own script. But...

I tried to populate intelliprompts using this article (WPF SyntaxEditor | IntelliPrompts | Telerik UI for WPF) but with no success.

Do you have a full example not only an extract? In which event I populate the overlad list?

 

Thank's for any help.

Martin Ivanov
Telerik team
 answered on 30 Jul 2021
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?