or
<Style x:Key="rowStyle" BasedOn="{StaticResource {x:Type telerik:TreeListViewRow}}" TargetType="{x:Type telerik:TreeListViewRow}"> <Style.Setters> <EventSetter Event="MouseDoubleClick" Handler="HandleRowDoubleClick" /> </Style.Setters> </Style> <Style x:Key="alternateRowStyle" BasedOn="{StaticResource rowStyle}" TargetType="{x:Type telerik:TreeListViewRow}"> </Style><Style x:Key="alternateRowStyle" BasedOn="{StaticResource rowStyle}" TargetType="{x:Type telerik:TreeListViewRow}"> <Style.Setters> <Setter Property="Background" Value="{Binding AlternateRowBackground, Source={RelativeSource TemplatedParent}}" /> </Style.Setters> </Style>I just installed the latest version of WPF controls (2013.3.1016.40) and my TreeView no longer registers this property. Can you tell me what the new alternative is for this property? Thanks.
tv.ItemsOptionListType = OptionListType.CheckList;BarSeries barSer = new BarSeries();barSer.ShowLabels = true;barSer.CombineMode = ChartSeriesCombineMode.Stack;// orBarSeries barSer = new BarSeries();barSer.ShowLabels = true;barSer.CombineMode = ChartSeriesCombineMode.Cluster;foreach (DataRow dr in dtData.Rows) { barSer.DataPoints.Add(new CategoricalDataPoint() { Category = dr["Name"], Label = string.Format("{0:N}", dr["Value"]), Value = double.Parse(dr["Value"].ToString()) }); }<telerik:RadScheduleView x:Name="ScheduleView" MinTimeRulerExtent="400" MaxTimeRulerExtent="1920" AppointmentNavigationButtonsVisibility="Never" ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}" telerik:StyleManager.Theme="Windows8" GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}"/>
this theme is definitive, but I would like to be able to change the theme's AccentColor at runtime, so I wrote a method to do this:
public static void ChangeTheme(ColorTheme theme)
{
var app = (App)Application.Current;
if (theme == app.CurrentTheme) return;
app.Resources.MergedDictionaries.Clear();
AddResourceDictionary("resources/Common.xaml");
AddResourceDictionary("resources/GeneralResources.xaml");
AddResourceDictionary("resources/MenuResources.xaml");
AddResourceDictionary("resources/DataGridResources.xaml");
AddResourceDictionary("resources/DatePickerResources.xaml");
app.CurrentTheme = theme;
try { AddResourceDictionary(string.Format(CultureInfo.InvariantCulture, "themes/{0}.xaml", theme)); }
catch { AddResourceDictionary("themes/Default.xaml"); }
Windows8Palette.Palette.AccentColor = (Color)Application.Current.Resources["ThemeColor"]; // pour le calendrier
}
private static void AddResourceDictionary(string source)
{
var resourceDictionary = Application.LoadComponent(new Uri(source, UriKind.Relative)) as ResourceDictionary;
Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
}
My issue is quite simple: the ScheduleView's color is always exactly one color late. i.e.:
let's say I have 3 theme colors : green, red, blue. Blue is the color at the beginning. I call the method to set the color to red, it stays blue. I call the method to set green, it becomes red, I call the color to set blue again, it becomes green, and so on...
can anybody tell me what I am doing wrong? I am at a complete lost as to how on earth this behaviour is possible...
Edit: I forgot a potentially usefull piece of information: this used to work with earlier versions of the telerik libraries (Q3 2012 as far as I remember). At the time, I used Windows8Colors.PaletteInstance, though, as it was not yet flagged as Obsolete.
The type 'DataRowView' does not contain a public property named 'DateTime'.Parameter name: propertyName<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="Testing.DataForm.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <telerik:RadDataForm Name="dataForm"/> </Grid></Window>using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.Data;namespace Testing.DataForm{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); GenerateSomeData(); } private void GenerateSomeData() { #region Data Generator DataTable baseTable = new DataTable(); baseTable.Columns.Add("DateTime", typeof(DateTime)); baseTable.Columns.Add("Value", typeof(decimal)); DateTime date = new DateTime(DateTime.Now.Year, 11, 1); TimeSpan span = date.AddMonths(1).AddDays(-1) - date; int numDays = span.Days; int randHigh = 65; int randLow = 0; #region RANDOM DATA GENERATOR Random rand = new Random(); int calculatedNumHours = 24 * numDays; for (int hour = 1; hour <= calculatedNumHours; hour++) { baseTable.Rows.Add(new object[] { date.AddHours(hour).AddSeconds(-1), rand.NextDouble() * ((randHigh - randLow) + randLow) }); } #endregion dataForm.ItemsSource = baseTable.DefaultView; #endregion } }}