Telerik Forums
UI for WPF Forum
1 answer
126 views
I am using the RadWindow.Prompt for a user to rename files and folders.  Is there a way for me to give the textbox that comes up in the Prompt the ability to ignore illegal filename characters?  { '\\', '/', '*', '<', '>', ':', '"', '?', '|' }).   Beyond Prompt I don't see how to access any other properties to do that.  I want the same behavior as Windows Explorer where if an illegal character is entered, it is just ignored as if it wasn't typed.
Yana
Telerik team
 answered on 18 Sep 2014
5 answers
224 views
Hello,

Is there a way to open the DropDownContent of the RadDropDownButton not on MouseUp, but already on MouseDown?
I could create an PreviewMouseDown event handler and toggle the IsOpen property. However, the button for some reason also captures the mouse so that I always get an inconsistent behavior on the second click. But when I say e.IsHandled = true, I cannot click any controls inside the popup...

The Idea is that the button should behave similar to a menu:
- The first click on button opens the popup, the second click anywhere outside of the popup closes it.
- A click inside of the popup is ignored by the button (I have different controls inside the popup, not only buttons).

Alex
Kiril Vandov
Telerik team
 answered on 18 Sep 2014
1 answer
145 views
Hi,

if i add the page number in the header or the footer, the correct numbers on every page are shown.
If i then edit the header on one page, every page shows the page number of that page.

before edit:

page 1 -> 1
page 2 -> 2
page 3 -> 3

after edit (edit of header on page 2):

page 1 -> 2
page 2 -> 2
page 3 -> 2

This behavior can be reproduced in the current telerik demo! How can i achieve a proper behavior?

Thanks for your help.
Aylin
Telerik team
 answered on 18 Sep 2014
4 answers
140 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
596 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
230 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
81 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
104 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
94 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
122 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?