Telerik Forums
UI for WPF Forum
4 answers
165 views
We have a hierarchical data bound to a treeview. Sometimes the business rules might changes invalidating some of the nodes. How do we go about indicating the invalid nodes in the tree?
Pavel R. Pavlov
Telerik team
 answered on 18 Sep 2014
5 answers
689 views
Through forum searches I've realized that you never actually dispose of a Pane, rather make IsHidden to True upon "close," either from a floating ToolWindow or when it's in its docked state.

This is very aggravating, and since I realize this is probably not something you'll change, I'm wondering why did you decide this was appropriate and how can I as a developer handle the resulting memory leaks? How am I to handle View/Viewmodel disposal when a user closes a Pane if the pane continues to exist with a strong reference via its Content and/or DataContext?

If there was even a proper event or argument that would signify a close, that would be fine - I could kill the view/vm myself. But, neither VisibilityChanged nor PaneStateChanged fire on close, and I don't see anything during Pane_Unloaded that would say for certain the pane is closing and not doing something like changing docking states (when you undock or re-dock a pane, its IsHidden is false during the transition, so that doesn't help at all).

TL;DR: Any thoughts on how to know when a pane is closed?
Kalin
Telerik team
 answered on 18 Sep 2014
4 answers
304 views
Data binding doesn't work when the Gauge control is hosted inside a Custom Control (we need to use Custom control for better performance)

See sample code below, the Gauge in MainWindow binds fine with the Ranges, but not the Gauge inside the custom control.

MainWindow.xaml
<Window x:Class="GaugeTest.MainWindow"
        xmlns:local="clr-namespace:GaugeTest"
        Title="MainWindow" Height="638" Width="575">
    <StackPanel>
        <telerik:RadRadialGauge Name="PART_Gauge" Width="220" Height="220">
            <telerik:RadialScale Name="scale"
                                 RangeLocation="Outside"
                                 LabelRotationMode="None"
                                 Radius="0.93"
                                 Ranges="{Binding Ranges}">
 
                <telerik:RadialScale.Indicators>
                    <telerik:BarIndicator Name="radialBar"
                                          UseRangeColor="True"
                                          RangeColorMode="ProportionalBrush"
                                          StartWidth="0.06"
                                          telerik:ScaleObject.Location="Outside"
                                          telerik:ScaleObject.Offset="0.01*"
                                          Value="0" />
                </telerik:RadialScale.Indicators>
            </telerik:RadialScale>
        </telerik:RadRadialGauge>
        <local:RadialGaugeControl Width="220" Height="220" />
    </StackPanel>
</Window>

MainWindow.cs
using System;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Gauge;
 
namespace GaugeTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            scale.SetCurrentValue(ScaleBase.RangesProperty, new GaugeRangeCollection());
 
            this.DataContext = new MainWindowViewModel();
        }
    }
 
    public class MainWindowViewModel : ViewModelBase
    {
        public MainWindowViewModel()
        {
            Ranges = new GaugeRangeCollection();
            AddRange(0, 30, Colors.Green);
            AddRange(30, 60, Colors.Yellow);
            AddRange(60, 100, Colors.Orange);
        }
 
        private void AddRange(double min, double max, Color color)
        {
            GaugeRange gr = new GaugeRange()
            {
                Min = min,
                Max = max,
                StartWidth = 0.01,
                EndWidth = 0.01,
                Background = new SolidColorBrush(color),
                IndicatorBackground = new SolidColorBrush(color),
                TickBackground = new SolidColorBrush(color),
                LabelForeground = new SolidColorBrush(color),
            };
            gr.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "Background")
                {
                    // make sure they are in sync
                    gr.IndicatorBackground = gr.Background;
                    gr.TickBackground = gr.Background;
                    gr.LabelForeground = gr.Background;
                }
            };
            Ranges.Add(gr);
        }
 
        private GaugeRangeCollection _ranges;
        public GaugeRangeCollection Ranges
        {
            get
            {
                return _ranges;
            }
            set
            {
                _ranges = value;
                OnPropertyChanged(() => Ranges);
            }
        }
    }
}

RadialGaugeControl.cs
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
 
namespace GaugeTest
{
    public class RadialGaugeControl : Control
    {
        static RadialGaugeControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RadialGaugeControl), new FrameworkPropertyMetadata(typeof(RadialGaugeControl)));
        }
    }
}

Theme\Generic.xaml
<ResourceDictionary
    xmlns:local="clr-namespace:GaugeTest">
 
 
    <Style TargetType="{x:Type local:RadialGaugeControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:RadialGaugeControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <telerik:RadRadialGauge Name="PART_Gauge" Width="220" Height="220">
                            <telerik:RadialScale Name="PART_Scale"
                                     RangeLocation="Outside"
                                     LabelRotationMode="None"
                                     Radius="0.93"
                                             Ranges="{Binding Ranges}">
 
                                <telerik:RadialScale.Indicators>
                                    <telerik:BarIndicator Name="radialBar"
                                              UseRangeColor="True"
                                              RangeColorMode="ProportionalBrush"
                                              StartWidth="0.06"
                                              telerik:ScaleObject.Location="Outside"
                                              telerik:ScaleObject.Offset="0.01*"
                                              Value="0" />
                                </telerik:RadialScale.Indicators>
                            </telerik:RadialScale>
                        </telerik:RadRadialGauge>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

App.xaml
<Application x:Class="GaugeTest.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.DataVisualization.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Paul
Top achievements
Rank 1
 answered on 18 Sep 2014
1 answer
109 views
So, after applying the toolbar commands from telerik demos I've noticed that the FixedDocumentViewer.CurrentPageNumber doesn't reset after changing the underlying pdf-document (doesn't work even in the demos). Is this a bug or must I update the current page number somehow manually after the document has changed?

PS: I prefer to use the MVVM-pattern.
Deyan
Telerik team
 answered on 18 Sep 2014
1 answer
126 views
Hello

I need to make a graph showing the results of an inspection of a steel bar. This inspection is performed at the level of millimeters. This inspection may result in some parts of the bar are corrupt, dirty, porous or acceptable. Each result of the inspection is shown with a different color. 

The RadCartesianChart can make a VerticalAxis, but can not find how to apply the colors and values ​​dynamically. I have only managed to secure a number the result of the graph. 

Is there any way to dynamically do this?
Martin Ivanov
Telerik team
 answered on 18 Sep 2014
3 answers
126 views
Hello,

we are using the DragDropManager to manage the drag/drop of items between a RadTileView from/to other type of controls. This works fine.
I have a question after reading this article: http://www.telerik.com/help/wpf/radtreeview-how-to-set-drag-cue-feedback-deny-drop.html
is it possible to accomplish the mentioned functionality (set drag cue feedback deny drop) with a RadTileView control instead of a RadTreeView?

thanks in advance,
Vincent
Zarko
Telerik team
 answered on 17 Sep 2014
1 answer
140 views
During row validation I am checking to see if the row is a duplicate of another row in the GridView. If it is a duplicate, I set IsValid to false.

In RowEditEnded, I only save the underlying entity back to the database if row.IsValid == true.

However, the duplicate row still hangs out in the GridView.  Additionally, if they close the Window and re-open it, the duplicate row is still there (it's a detached entity) even though it hasn't been persisted to the database.  The duplicate row only disappears when the close the appellation and re-launch it.

I could remove all detached entities when the window is closing, but I'm hoping I can just remove the duplicate row in the RowValidating or RowValidated event handlers.

Any suggestions?

Thanks.

Aaron
Dimitrina
Telerik team
 answered on 17 Sep 2014
1 answer
224 views
Hi,

Can you explain the following settings; the documentation is not very clear

AutoCalculateClusteringThreshold = true;
ClusteringEnabled = true;
ClusteringEnabledThreshold = 18;
ClusteringEnabledThresholdMinItems = 100;


I have changed my code to use the VisualisationLayer instead of a DynamicLayer to try and improve performance.  I used to handle the clustering of my points in the code, but now want to use your mechanism.

My datasource may contain say 5000 pin points, all in the uk.
When I zoom to see all of the uk, I would like the points clustered
When I zoom in, I would like to see the points clustered until we get to a point where we can safely display the points e.g. if there are less than 100 visible points in the viewport.
At the moment, I seem to get clustering all the time, and it shows clusters even when there is just a single point

Thanks
Simon

Martin Ivanov
Telerik team
 answered on 17 Sep 2014
6 answers
545 views
Hi,

is there a way to achieve that the validation error tooltip is not only shown if the mouse cursor is within the red triangle in the upper right corner of the cell but also when it is somewhere else in the area of the invalid cell? I need this behaviour especially in non-edit mode.

Regards Uli
Vanya Pavlova
Telerik team
 answered on 17 Sep 2014
1 answer
130 views
I used RadPdfViewer in WPF. I put the pdfviewer in grid. I set the height="*". But the problem is, the pdfviewer extends beyond the screensize of the window and the scrollviewer also not working. Help me to fix it. I have attcached the Snapshot of the window.

<Grid  >
       <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
 <telerik:RadPdfViewer Grid.Row="0" x:Name="pdfViewer1"  DocumentSource="{Binding url1}"  telerikControls:StyleManager.Theme="Expression_Dark">
 </telerik:RadPdfViewer>
</Grid>
Deyan
Telerik team
 answered on 17 Sep 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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?