Telerik Forums
UI for WPF Forum
1 answer
130 views
Hi,

I'm using a RadTimePicker in a ControlTemplate and would like to set "DateTimeWatermarkContent" to another value. Unfortunately the value is not used and shows still "Enter time". Also I would like to change the Header on the drop down clock which has value "Clock".

Here the code:

<ContentControl Grid.Row="1" Grid.Column="1" Width="80" Style="{StaticResource styleContentControlTime}" Content="{Binding OfficeHour.MondayOpen, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" ></ContentControl>

here the style:

 <Style x:Key="styleContentControlTime" TargetType="ContentControl">
        <Setter Property="IsTabStop" Value="false"></Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding  Path=InEditMode}" Value="true">
                <Setter Property="ContentControl.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <telerik:RadTimePicker SelectedValue="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                       Margin="10,3" DateTimeWatermarkContent="" >
                                </telerik:RadTimePicker>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>

            <DataTrigger Binding="{Binding  Path=InEditMode}" Value="false">
                <Setter Property="ContentControl.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Grid >
                                <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, Converter={StaticResource dateTimeToTimeStringConverter}}"
                                           Style="{StaticResource styleTextBlock}" VerticalAlignment="Center"></TextBlock>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>

regrads,
Timo
Kaloyan
Telerik team
 answered on 13 Sep 2010
7 answers
438 views
Hi,

I've been evaluating the WPF charting component and am really struggling to find out how to change the colour palette for a pie chart. Can anyone help?

Also noticed that when you resize the width of a window containing a 3D pie chart, the chart will scale, but if you adjust the height, it doesn't. Am I doing something wrong? Code below:

<Window x:Class="Telerik1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    Title="Window1" Height="600" Width="800" Loaded="ExampleControl_Loaded" Unloaded="ExampleControl_Unloaded">  
    <Window.Resources> 
        <Style TargetType="{x:Type telerik:RadChart}">  
            <Setter Property="telerik:Theming.Theme">  
                <Setter.Value> 
                    <telerik:VistaTheme/> 
                </Setter.Value> 
            </Setter> 
        </Style> 
        
    </Window.Resources> 
    <Grid> 
        <telerik:RadChart x:Name="RadChart1" /> 
    </Grid> 
</Window> 
 


Thanks,
Gary.
Giuseppe
Telerik team
 answered on 13 Sep 2010
1 answer
130 views
If I call this code in a virtualized scroll viewer with 3000 thousand items, the ScrollViewer won't move even 25% of the number of times I call it:

for (int i = 0; i < 1000; i++)
{
    radTreeView.ScrollViewer.LineDown();
}

For some reason it stops at some point. Let me know if there's a way to fix this. I want to be able to move the RadTreeView a certain amount of times when the user clicks on a button, but this is preventing me from doing it, some times the amount is very large as in the example code above.

Thanks.
Miro Miroslavov
Telerik team
 answered on 13 Sep 2010
1 answer
149 views

Hi,
I have the following combobox that I am trying to use essentially as an edit field and the dropdown list as a collection of predefined values that the user can select.

The problem is that the 'Clear' button in the dropdown list (that shows up due to the 'ClearSelectionButtonVisibility' property) does not always clear the text. It works fine if I select an item from the dropdown list before the clear, but if I type in text that does not match any of the items then it does nothing.
Best regards,
Pete

 


<
telerik:RadRibbonComboBox

 

 

CanAutocompleteSelectItems="True"

 

 

CanKeyboardNavigationSelectItems="True"

 

 

ClearSelectionButtonVisibility="Visible"

 

 

EmptyText="Enter text"

 

 

FilteringMode="Contains"

 

 

IsEditable="True"

 

 

IsFilteringEnabled="True"

 

 

IsReadOnly="False"

 

 

ItemsSource="{Binding Source={x:Static local:Core.App}, Path=SummaryTextForAllGames, Mode=OneWay}"

 

 

MinWidth="250"

 

 

OpenDropDownOnFocus="True"

 

 

StaysOpenOnEdit="True"

 

 

Text="{Binding Path=Value, Mode=TwoWay}"

 

 

TextSearchMode="Contains"

 

 

VerticalAlignment="Center"

 

 

/>

 

Valeri Hristov
Telerik team
 answered on 13 Sep 2010
3 answers
323 views
When I use the page down key or the mouse wheel to scroll down a virtualized RadTreeView, I get this bug:



The RadTreeViewItems that disappear are actually null when I get in to debug. Why does this happen? It's causing me a problem where a RadTreeViewItem I'm tracking suddenly disappears from memory, even though I have a few other pointers referencing it, it just goes away.

Let me know if there is a solution to this.

Thanks!

Here's my code:

XAML:
<Window x:Class="TreeViewComparison.Window1"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    Title="Window1" Height="305" Width="627">
    <Window.Resources>
        <HierarchicalDataTemplate x:Key="ItemTemplate" ItemsSource="{Binding SubItems}">
            <TextBlock Text="{Binding Header}"/>
        </HierarchicalDataTemplate>
 
        <Style TargetType="telerik:RadTreeViewItem">
            <Setter Property="IsExpanded" Value="True"/>
        </Style>
         
    </Window.Resources>
     
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <telerik:RadTreeView x:Name="radTreeView"
                             Grid.Row="0"
                             IsVirtualizing="True"
                             ItemTemplate="{StaticResource ItemTemplate}" />
        <Button x:Name="buttonBreakpoint" Grid.Row="1" Margin="8" Content="Breakpoint" Click="buttonBreakpoint_Click" />
    </Grid>
</Window>

C#:

using System;
using System.Collections.ObjectModel;
using System.Windows;
 
namespace TreeViewComparison
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
 
            this.radTreeView.ItemsSource = GenerateItems();
        }
 
        private ObservableCollection<DataItem> GenerateItems()
        {
            ObservableCollection<DataItem> result = new ObservableCollection<DataItem>();
 
            for (int i = 0; i < 10; i++)
            {
                DataItem item = new DataItem(String.Format("Item {0}", i));
                for (int j = 0; j < 100; j++)
                {
                    item.SubItems.Add(new DataItem(String.Format("Item {0}.{1}", i,j)));
                }
 
                result.Add(item);
            }
            return result;
        }
 
        class DataItem
        {
            public DataItem(string header)
            {
                this.SubItems = new ObservableCollection<DataItem>();
                this.Header = header;
            }
            public string Header { get; set; }
 
            public ObservableCollection<DataItem> SubItems { get; set; }
        }
         
        private void buttonBreakpoint_Click(object sender, RoutedEventArgs e)
        {
         
        }
    }
}
Hristo
Telerik team
 answered on 13 Sep 2010
1 answer
44 views
Hello:

Quick question: Is it possible to drag a RadPane from one RadDocking (source) to another one (target)? Can I dock it to the target RadDocking?

thanks
Konstantina
Telerik team
 answered on 13 Sep 2010
1 answer
107 views
Hello :)

Linq to Sql automatically generates classes that represents the relational tables of sql server as Objects in C#.
This Linq to Sql classes implements the INotifyPropertyChanging and INotifyPropertyChanged like this:
[Table(Name="dbo.hotel")]
    public partial class hotel : INotifyPropertyChanging, INotifyPropertyChanged
    {
         
        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
         
        private int _idHotel;
         
        private int _ProveedorEmpresa_idProveedorEmpresa;
         
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidHotelChanging(int value);
    partial void OnidHotelChanged();
    partial void OnProveedorEmpresa_idProveedorEmpresaChanging(int value);
    partial void OnProveedorEmpresa_idProveedorEmpresaChanged();
    #endregion
         
        public hotel()
        {
            OnCreated();
        }
         
        [Column(Storage="_idHotel", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
        public int idHotel
        {
            get
            {
                return this._idHotel;
            }
            set
            {
                if ((this._idHotel != value))
                {
                    this.OnidHotelChanging(value);
                    this.SendPropertyChanging();
                    this._idHotel = value;
                    this.SendPropertyChanged("idHotel");
                    this.OnidHotelChanged();
                }
            }
        }
         
        [Column(Storage="_ProveedorEmpresa_idProveedorEmpresa", DbType="Int NOT NULL")]
        public int ProveedorEmpresa_idProveedorEmpresa
        {
            get
            {
                return this._ProveedorEmpresa_idProveedorEmpresa;
            }
            set
            {
                if ((this._ProveedorEmpresa_idProveedorEmpresa != value))
                {
                    this.OnProveedorEmpresa_idProveedorEmpresaChanging(value);
                    this.SendPropertyChanging();
                    this._ProveedorEmpresa_idProveedorEmpresa = value;
                    this.SendPropertyChanged("ProveedorEmpresa_idProveedorEmpresa");
                    this.OnProveedorEmpresa_idProveedorEmpresaChanged();
                }
            }
        }
         
        public event PropertyChangingEventHandler PropertyChanging;
         
        public event PropertyChangedEventHandler PropertyChanged;
         
        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }
         
        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

If I bind the ItemSource of a RadGridView to a ObservableCollection of this classes generated by Linq to Sql, is necessary to do anything else in order to the gridview automatically updates its rows data or add and remove rows by just updating the ObservableCollection? Because the gridview is not updating its data.

I hope you can help me.

Best regards, Jorge
Vlad
Telerik team
 answered on 13 Sep 2010
5 answers
218 views
Hello,

How is it possible to specify columns for child table?

I don't want columns for hierarchical grid to be auto generated.

I'm reading http://www.telerik.com/help/wpf/gridview-basic-hierarchies.html but it does not seam to be there

Thank You
Vlad
Telerik team
 answered on 13 Sep 2010
3 answers
196 views
Do Adorners work with Docking?
I have a floating rad Pane and I have added an adorner in RadPane_Loaded event

private void RadPane_Loaded(object sender, RoutedEventArgs e)
        {
            AdornerLayer layer = AdornerLayer.GetAdornerLayer(MyImage); /// IS NULL
           
        }

But it is always null.

Xaria D
Top achievements
Rank 1
 answered on 13 Sep 2010
3 answers
136 views
I was wondering is it possible to change the TileViewItem TileState= Max.Min, and Restore with Button click Code From behind?

Thanks
Rick Mueller
Top achievements
Rank 1
 answered on 11 Sep 2010
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
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?