I'm attempting to change the SelectedUnfocused VisualState. I've extracted the style using Blend, made the correction for the Item Template Selector, and have set the Selected Unfocused Visual State to StoryBoard.TargetName="SelectionVisual". So focused/unfocused look the same.
I'm also setting the StyleManager.ApplicationTheme to Windows7Theme in the window constructor prior to the InitializeComponent() call.
Simple xaml. I would expect the highlights to be a blue-ish color. However, they are the orange-ish color.
<Grid>
<telerik:RadTreeView ItemsSource="{Binding Nodes}"
ItemTemplateSelector="{StaticResource TreeViewTemplateSelector}"
ItemContainerStyle="{DynamicResource RadTreeViewItemStyle1 }"/>
</Grid>
However, if I do this, setting a simple property on the Item Container Style, the theme works.
<Grid>
<telerik:RadTreeView ItemsSource="{Binding Nodes}"
ItemTemplateSelector="{StaticResource TreeViewTemplateSelector}">
<telerik:RadTreeView.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<Setter Property="IsExpanded" Value="True"></Setter>
</Style>
</telerik:RadTreeView.ItemContainerStyle>
</telerik:RadTreeView>
<!--ItemContainerStyle="{DynamicResource RadTreeViewItemStyle1 }"/>-->
</Grid>
I know the second case doesn't change the unfocused selection visual state, so how might I get theming to work when basing the Item Container Style on a complete style?
Thanks,
Kenny
I've found very strange behavior.
A simple project contains the window with RadGridView. ItemsSource is binded to ViewModel.Rows where Rows is ObservableCollection.
I fill rows inside Window Loaded event.
RadGridView doen't updated if I don't use Rows.Clear() before Rows.Add().
Can you explain this?
Here is xaml:
01.
<
Window
x:Class
=
"TelerikWpfApp1.MainWindow"
03.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
04.
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
05.
xmlns:local
=
"clr-namespace:TelerikWpfApp1"
06.
Loaded
=
"Window_Loaded"
>
07.
<
Window.Resources
>
08.
<
local:ViewModel
x:Key
=
"vm"
/>
09.
</
Window.Resources
>
10.
<
Grid
DataContext
=
"{Binding Mode=OneWay, Source={StaticResource vm}}"
>
11.
<
telerik:RadGridView
ItemsSource
=
"{Binding Rows}"
/>
12.
</
Grid
>
13.
</
Window
>
And code behind:
01.
using
System.Collections.ObjectModel;
02.
using
System.Windows;
03.
04.
namespace
TelerikWpfApp1
05.
{
06.
public
partial
class
MainWindow : Window
07.
{
08.
public
MainWindow()
09.
{
10.
InitializeComponent();
11.
}
12.
13.
private
void
Window_Loaded(
object
sender, RoutedEventArgs e)
14.
{
15.
var rows = ((ViewModel)FindResource(
"vm"
)).Rows;
16.
// to make it work uncomment the next row
17.
//rows.Clear();
18.
rows.Add(
new
Row { Name =
"Name1"
, Column1 =
"value1_1"
});
19.
rows.Add(
new
Row { Name =
"Name2"
, Column1 =
"value2_1"
});
20.
}
21.
}
22.
23.
class
Row
24.
{
25.
public
string
Name {
get
;
set
; }
26.
public
string
Column1 {
get
;
set
; }
27.
}
28.
29.
class
ViewModel
30.
{
31.
public
ObservableCollection<Row> Rows {
get
; } =
new
ObservableCollection<Row>();
32.
}
33.
}
Hi,
I have a radform that is opened in the rowdetails of a radgrid that is in a radpane. If I change the value of a textbox, for example, and click on another control in the radform and then try to close pane, the previewclose event fires and I (after checking for changes) ask the user if they want to save changes and all is well. However, if instead of clicking on another control in the radform, I close the pane either by clicking on the X in the upper right hand corner of the pane or via code by setting the visibility property to hidden, I never get the previewclose event. Is this a bug? Is there a work around?
Thanks ... Ed
I've recently upgraded my visual studio from 2010 to 2015, and since them, I'm getting a lot of warnings in my output window like:
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='10705061';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='1587067';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='4309168';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='59694858'; Freezable.Type='System.Windows.Media.TranslateTransform';
DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='1914083';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='19024873';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='50812954';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='4881566';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='18343908';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='20169503';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='35212414';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='41054801'; Freezable.Type='System.Windows.Media.TranslateTransform';
DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='35526744';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='55199627';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='955278';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='42987539';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='55391087';
Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X';
DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning
false because a DependencyProperty on the Freezable has a value that is an
expression; Freezable='System.Windows.Media.TranslateTransform';
Freezable.HashCode='9570975'; Freezable.Type='System.Windows.Media.TranslateTransform';
DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
It happens every time a value in the gridview is changed.
It affects the performance of visual studio, since the output window is very busy.
Why it happens? It is something you are doing wrong and can be fixed?
Can I disable these warnings somehow?
Thanks.
Dear Telerik support,
My datetime columns arebehaving just the same as you can seein your article here
http://docs.telerik.com/devtools/wpf/controls/radgridview/export/how-to/export-datetime
Then i tried the given solution,but although the event is being called and the Format being attributed with the correct format, the solution doesn't not working for me. My datetime columns cells show as #########
Can you please check my code and see if i am missing something?
private
void
CustomGridview_ElementExportingToDocument(
object
sender, GridViewElementExportingToDocumentEventArgs e)
{
if
(e.Element == ExportElement.Cell)
{
var cellExportingArgs = e
as
GridViewCellExportingEventArgs;
var parameters = cellExportingArgs.VisualParameters
as
GridViewDocumentVisualExportParameters;
if
(cellExportingArgs.Column.GetType() ==
typeof
(GridViewDataColumn))
{
if
(((GridViewDataColumn)cellExportingArgs.Column).DataFormatString ==
"d"
)
{
parameters.Style =
new
CellSelectionStyle()
{
Format =
new
CellValueFormat(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
};
}
if
(((GridViewDataColumn)cellExportingArgs.Column).DataFormatString ==
"g"
)
{
parameters.Style =
new
CellSelectionStyle()
{
Format =
new
CellValueFormat(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern +
" "
+ CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern)
};
}
}
}
}
Thank you
<
telerik:RadTimeBar
Height
=
"130"
Name
=
"RadTimeBar1"
PeriodEnd
=
"04/10/2014 00:00:00"
PeriodStart
=
"03/31/2012 00:00:00"
SelectionEnd
=
"04/06/2012 00:00:00"
SelectionStart
=
"04/05/2012 00:00:00"
Width
=
"Auto"
Cursor
=
"Hand"
Content
=
"From here you can chose the interval the below data will be shown"
IsManipulationEnabled
=
"True"
UseLayoutRounding
=
"True"
>
<
telerik:RadTimeBar.Intervals
>
<
telerik:YearInterval
/>
<
telerik:MonthInterval
/>
<
telerik:WeekInterval
/>
<
telerik:DayInterval
/>
</
telerik:RadTimeBar.Intervals
>
</
telerik:RadTimeBar
>
Hi,
I'm trying to show on the same chart different series types, I need to show Point3d and also Surface3d.
I have no idea why it's not working, actually it shows my surface3d as point3d.
this is the xaml code:
<Window x:Class="TelerikWpfApp76.MainWindow"
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:po="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="po"
Title="MainWindow" Height="475.829" Width="525"
po:DesignHeight="300"
po:DesignWidth="300"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Window.Resources>
</Window.Resources>
<Grid Width="{Binding ActualWidth, RelativeSource = {RelativeSource AncestorType = {x:Type Window}}}"
Height="{Binding ActualHeight, RelativeSource ={RelativeSource AncestorType = {x:Type Window}}}">
<telerik:RadCartesianChart3D x:Name="radCartesian" HorizontalContentAlignment="Stretch">
<telerik:RadCartesianChart3D.Behaviors>
<telerik:Chart3DCameraBehavior/>
<telerik:Chart3DTooltipBehavior/>
</telerik:RadCartesianChart3D.Behaviors>
<telerik:RadCartesianChart3D.XAxis>
<telerik:LinearAxis3D>
<telerik:LinearAxis3D.LabelStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#0000cc" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</telerik:LinearAxis3D.LabelStyle>
</telerik:LinearAxis3D>
</telerik:RadCartesianChart3D.XAxis>
<telerik:RadCartesianChart3D.YAxis>
<telerik:LinearAxis3D>
<telerik:LinearAxis3D.LabelStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#000066" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</telerik:LinearAxis3D.LabelStyle>
</telerik:LinearAxis3D>
</telerik:RadCartesianChart3D.YAxis>
<telerik:RadCartesianChart3D.ZAxis>
<telerik:LinearAxis3D>
<telerik:LinearAxis3D.LabelStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#CA5100" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</telerik:LinearAxis3D.LabelStyle>
</telerik:LinearAxis3D>
</telerik:RadCartesianChart3D.ZAxis>
<telerik:RadCartesianChart3D.Series>
<telerik:PointSeries3D x:Name="fenceSeries"
PointSize="20 20 20"
XValueBinding="X"
YValueBinding="Y"
ZValueBinding="Z"
ItemsSource="{Binding Path=Fence}">
<telerik:PointSeries3D.DefaultVisualMaterial>
<MaterialGroup>
<DiffuseMaterial Brush ="#BF444444"/>
<SpecularMaterial Brush="#BF444444" SpecularPower="30" />
</MaterialGroup>
</telerik:PointSeries3D.DefaultVisualMaterial>
<telerik:PointSeries3D.TooltipTemplate>
<DataTemplate>
<Border Background="#5A000000"
Padding="5" TextElement.Foreground="White">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Track Fence"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="X - " FontWeight="Bold" />
<TextBlock Text="{Binding XValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Y - " FontWeight="Bold" />
<TextBlock Text="{Binding YValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Z - " FontWeight="Bold" />
<TextBlock Text="{Binding ZValue}" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</telerik:PointSeries3D.TooltipTemplate>
</telerik:PointSeries3D>
<telerik:SurfaceSeries3D x:Name="searchSeries"
XValueBinding="X"
YValueBinding="Y"
ZValueBinding="Z"
ItemsSource="{Binding Path=SearchFence}">
<telerik:SurfaceSeries3D.DefaultVisualMaterial>
<MaterialGroup>
<DiffuseMaterial Brush ="#B7EDFF"/>
<SpecularMaterial Brush="#B7EDFF" SpecularPower="30" />
</MaterialGroup>
</telerik:SurfaceSeries3D.DefaultVisualMaterial>
<telerik:SurfaceSeries3D.TooltipTemplate>
<DataTemplate>
<Border Background="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ToolTipColor}"
Padding="5" TextElement.Foreground="White">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Search Fence"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="X - " FontWeight="Bold" />
<TextBlock Text="{Binding XValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Y - " FontWeight="Bold" />
<TextBlock Text="{Binding YValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Z - " FontWeight="Bold" />
<TextBlock Text="{Binding ZValue}" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</telerik:SurfaceSeries3D.TooltipTemplate>
</telerik:SurfaceSeries3D>
<telerik:PointSeries3D x:Name="series"
PointSize="20 20 20"
XValueBinding="X"
YValueBinding="Y"
ZValueBinding="Z"
ItemsSource="{Binding Path=Traj}">
<telerik:PointSeries3D.TooltipTemplate>
<DataTemplate>
<Border Background="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ToolTipColor}"
Padding="5" TextElement.Foreground="White">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Trajectory"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="X - " FontWeight="Bold" />
<TextBlock Text="{Binding XValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Y - " FontWeight="Bold" />
<TextBlock Text="{Binding YValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Z - " FontWeight="Bold" />
<TextBlock Text="{Binding ZValue}" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</telerik:PointSeries3D.TooltipTemplate>
</telerik:PointSeries3D>
</telerik:RadCartesianChart3D.Series>
<telerik:RadCartesianChart3D.Grid>
<telerik:CartesianChart3DGrid />
</telerik:RadCartesianChart3D.Grid>
</telerik:RadCartesianChart3D>
</Grid>
</Window>
Thanks!
I have a combobox like below and i need to have a required field validation on it.
<
telerik:RadComboBox
x:Name
=
"combobox"
SelectionChanged
=
"combobox_SelectionChanged"
IsTextSearchEnabled
=
"True"
Width
=
"120"
telerik:TextSearch.TextPath
=
"Kode"
Margin
=
"2,0,0,0"
IsEditable
=
"True"
IsReadOnly
=
"True"
SelectedItem
=
"{Binding Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
TextSearchMode
=
"Contains"
CanAutocompleteSelectItems
=
"True"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"50"
/>
<
ColumnDefinition
Width
=
"300"
/>
<
ColumnDefinition
Width
=
"300"
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Text
=
"{Binding Kode}"
Grid.Column
=
"0"
/>
<
TextBlock
Text
=
"{Binding Nederlandse_omschrijving}"
Grid.Column
=
"1"
/>
<
TextBlock
Text
=
"{Binding Franse_omschrijving}"
Grid.Column
=
"2"
/>
</
Grid
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
DummyComboBox.ItemsSource = DummyCodeList.Load()
The load event returns a list of Objects (List<DummyObject>)
I can't quite get the validation working.
Any suggestions ?