Telerik Forums
UI for WPF Forum
1 answer
135 views
Hello, 

Below is a part of the template of CollectionEditor. I've added a new button named "ButtonClose" in to the footer of the collection editor. What should I do in code behind to make the collection editor close? Simply change the visibility?



<Border x:Name="FooterPanel_Background" Grid.Row="3" BorderBrush="{StaticResource ControlOuterBorder}" BorderThickness="0,1,0,0"  Grid.ColumnSpan="2" Background="{StaticResource CollectionEditor_FooterPanel_Background}">
                            <Grid>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                    <telerik:RadButton IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" 
                                                       MinWidth="48"  MinHeight="21"  Margin="4,6,4,7" 
                                                       telerik:StyleManager.Theme="{StaticResource Theme}" 
                                                       telerik:LocalizationManager.ResourceKey="CollectionEditorAdd"
                                                       Command="{x:Static propertyGrid:CollectionEditorCommands.AddNew}"/>
                                    <telerik:RadButton IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" 
                                                       MinWidth="48" MinHeight="21"  Margin="0,6,4,7" 
                                                       telerik:StyleManager.Theme="{StaticResource Theme}" 
                                                       telerik:LocalizationManager.ResourceKey="CollectionEditorRemove"
                                                       Command="{x:Static propertyGrid:CollectionEditorCommands.Delete}"/>
                                    <telerik:RadButton MinWidth="48" MinHeight="21"  Margin="0,6,4,7" Name="ButtonClose"
                                                       telerik:StyleManager.Theme="{StaticResource Theme}" 
                                                       Content="Close"
                                                       Click="ButtonClose_Click"/>
                                </StackPanel>
                                <Thumb x:Name="PART_ResizeThumb" Style="{StaticResource CollectionEditorGripperStyle}" Visibility="{TemplateBinding ResizeGripperVisibility}"/>
                            </Grid>
                        </Border>
Dimitrina
Telerik team
 answered on 19 Sep 2014
3 answers
89 views
When draging a toolboxitem from the toolbox gallery into the diagram is it possible to automatically open the SettingsPane ?

I have the following scenario: The user drags components from the toolbox into the diagram , the components have a few mandatory properties that needs to be set in its business object. My strategy is to put a form for the input of these properties in the SettingsPane and have this open whenever a new component is dropped into the diagram.

Petar Mladenov
Telerik team
 answered on 19 Sep 2014
1 answer
101 views
Hi,

I have a propertygrid with dynamically generated property definitions. I am currently setting the EditorTemplate for each PropertyDefinition at run time.
The issue I am facing is, when I use tab key to navigate from one row to another with the focus on the template, the next PropertyDefinition is not getting selected.
FYI, I used the keyboard navigation support for tabbing. This works fine on AutoGenerated columns but not on custom columns.

Thanks and Regards,
Nagarajan B P
Dimitrina
Telerik team
 answered on 18 Sep 2014
3 answers
138 views
I have a comboBox on my page after this comboBox i have a Telerik:RadTabControl with 3 tabs.

Upon loading this particular window the 3 Tabs pf tje RadTabControl are disabled. If the change event of the comboBox when a value has been selected I want to enable the 3 tabs.

How do I do this?
Julian
Top achievements
Rank 1
 answered on 18 Sep 2014
1 answer
141 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
240 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
167 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
152 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
664 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
293 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
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?