or
public enum ObjectState{ Unchanged = 0, New = 1, Updated = 2, Deleted = 3,}public class ObjectStateStyleSelector : StyleSelector { public Style UnchangedStyle { get; set; } public Style ChangedStyle { get; set; } public Style AddedStyle { get; set; } public Style DeletedStyle { get; set; } public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container) { if (item != null) { Model model = item as Model; if (model != null) { switch (model.ObjectState) { case ObjectState.New: return this.AddedStyle; case ObjectState.Updated: return this.ChangedStyle; case ObjectState.Unchanged: return this.UnchangedStyle; case ObjectState.Deleted: return this.DeletedStyle; } } } return null; } }public class Model : INotifyPropertyChanged { private ObjectState m_objectState; private int m_id; private string m_description; public ObjectState ObjectState { get { return m_objectState; } set { if (m_objectState == value) return; m_objectState = value; OnNotifyPropertyChanged("ObjectState"); } } public int ID { get { return this.m_id; } set { if (this.m_id == value) return; this.m_id = value; UpdateState(); OnNotifyPropertyChanged("ID"); } } public string Description { get { return this.m_description; } set { if (this.m_description == value) return; this.m_description = value; UpdateState(); OnNotifyPropertyChanged("Description"); } } public Model() { this.ObjectState = GridProblem.ObjectState.New; } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; private void OnNotifyPropertyChanged(string prop) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs(prop)); } } private void UpdateState() { if (m_objectState == GridProblem.ObjectState.Unchanged) { m_objectState = GridProblem.ObjectState.Updated; } } #endregion }<Window x:Class="GridProblem.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:main="clr-namespace:GridProblem" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <main:ObjectStateStyleSelector x:Key="GridColumnObjectStateStyleSelector"> <main:ObjectStateStyleSelector.AddedStyle> <Style TargetType="telerik:GridViewCell"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="+" FontSize="20" FontWeight="Bold" Foreground="Green" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> </DataTemplate> </Setter.Value> </Setter> </Style> </main:ObjectStateStyleSelector.AddedStyle> <main:ObjectStateStyleSelector.ChangedStyle> <Style TargetType="telerik:GridViewCell"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="*" FontSize="20" FontWeight="Bold" Foreground="OrangeRed" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> </DataTemplate> </Setter.Value> </Setter> </Style> </main:ObjectStateStyleSelector.ChangedStyle> <main:ObjectStateStyleSelector.UnchangedStyle> <Style TargetType="telerik:GridViewCell"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> </DataTemplate> </Setter.Value> </Setter> </Style> </main:ObjectStateStyleSelector.UnchangedStyle> </main:ObjectStateStyleSelector> </Window.Resources> <Grid> <telerik:RadGridView x:Name="mainGrid" ItemsSource="{Binding Path=Items}" CanUserInsertRows="True" ShowInsertRow="True" AutoGenerateColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn CellStyleSelector="{StaticResource GridColumnObjectStateStyleSelector}" DataMemberBinding="{Binding Path=ObjectState}" /> <telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding Path=ID}"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Path=Description}"></telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></Window>Hi everyone.
In our project, we have just upgraded the version of the controls from 2012Q3 to 2013Q2. With the new version, we see something strange in the time ruler in the ScheduleView, when we are doing TimeZone grouping. You can see this behavior in the attached captures.
2012 Q3:
http://i.imgur.com/u59u7V3.png
2013 Q2:
http://i.imgur.com/3Tb50Js.png
In 2013 Q2 image, I've marked this time ruler, seems that the time is added rather than substracted (I'm expecting to see the time ruler like 2012 Q3 capture, the time in Canary Islands must be -1 rather than +1).
Any help? Is this change intended, and if it is, can I go back to the 2012 Q3 behavior with the new version?
Thank you.
<ControlTemplate TargetType="{x:Type telerik:GridViewHeaderRow}"> <telerik:SelectiveScrollingGrid> <telerik:SelectiveScrollingGrid.ColumnDefinitions> <ColumnDefinition Width="11"/> <ColumnDefinition Width="14"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </telerik:SelectiveScrollingGrid.ColumnDefinitions> <telerik:SelectiveScrollingGrid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </telerik:SelectiveScrollingGrid.RowDefinitions> <telerik:CommonHeaderPresenter x:Name="PART_CommonHeaderPresenter" Grid.Column="4" IsTabStop="False" Grid.Row="1" d:LayoutOverrides="GridBox"> </telerik:CommonHeaderPresenter> <Border x:Name="CommonHeaderIndent" BorderBrush="#00848484" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.ColumnSpan="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding Visibility, ElementName=PART_CommonHeaderPresenter}" Grid.Row="1" d:LayoutOverrides="GridBox"/> <Grid x:Name="PART_OuterGrid" Grid.ColumnSpan="5" Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Border x:Name="PART_GridViewHeaderRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> <Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}"/> </Border> </Grid> <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="4" IsTabStop="False" Grid.Row="1"> </telerik:DataCellsPresenter> <Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" Width="25" Grid.ColumnSpan="2"> <Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}"> </Border> </Border> <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="4" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" MinHeight="{TemplateBinding MinHeight}" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" d:LayoutOverrides="GridBox"> <telerik:IndentPresenter.ItemTemplate> <DataTemplate> <telerik:GridViewHeaderIndentCell IsTabStop="False"> </telerik:GridViewHeaderIndentCell> </DataTemplate> </telerik:IndentPresenter.ItemTemplate> </telerik:IndentPresenter> <Border x:Name="PART_CommonHeaderHierarchyIndentPresenterAllLevels" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.Column="4" Grid.Row="1" Grid.RowSpan="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" Margin="0,0,233.907,0"> <Border.Visibility> <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}"> <Binding.Converter> <telerik:BooleanToVisibilityConverter/> </Binding.Converter> </Binding> </Border.Visibility> </Border> <Border x:Name="PART_CommonHeaderHierarchyIndentPresenterFirstLevel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.Column="4" Margin="0,-1,233.907,0" Grid.Row="0" Grid.RowSpan="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" d:LayoutOverrides="GridBox"> <Border.Visibility> <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}"> <Binding.Converter> <telerik:BooleanToVisibilityConverter/> </Binding.Converter> </Binding> </Border.Visibility> </Border> <Border x:Name="PART_HierarchyIndentPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Grid.Column="4" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" Margin="0,0,233.907,0" d:LayoutOverrides="GridBox"> <Border.Visibility> <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}"> <Binding.Converter> <telerik:BooleanToVisibilityConverter/> </Binding.Converter> </Binding> </Border.Visibility> <Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}" /> </Border> </telerik:SelectiveScrollingGrid> </ControlTemplate>