Hi,
I'm trying to change column headers style in my GanttView.
I'm using this code:
But that style impacts only 1st and 3d columns, while 2nd column style is not impacted (see attachment).
What am I missing?
Thanks,
Yevgeny
I'm trying to change column headers style in my GanttView.
I'm using this code:
<
Style
TargetType
=
"GanttView:ColumnHeaderContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"#3d3d3d"
/>
<
Setter
Property
=
"Background"
Value
=
"#C0C0C0"
/>
</
Style
>
But that style impacts only 1st and 3d columns, while 2nd column style is not impacted (see attachment).
What am I missing?
Thanks,
Yevgeny
11 Answers, 1 is accepted
0
Hello Yevgeny,
The GanttView provides alternating background colors for the columns as well as the rows. That is why the background is affecting only the odd columns. In order to change the background of the even columns you will also need to set the AlternatingBackground property of the ColumnHeaderContainer to the same color. In your scenario the Style should look as follows:
Hope this helps. If you have any other questions, let us know.
Regards,
Kalin
Telerik
The GanttView provides alternating background colors for the columns as well as the rows. That is why the background is affecting only the odd columns. In order to change the background of the even columns you will also need to set the AlternatingBackground property of the ColumnHeaderContainer to the same color. In your scenario the Style should look as follows:
<
Style
TargetType
=
"telerik:ColumnHeaderContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"#3d3d3d"
/>
<
Setter
Property
=
"Background"
Value
=
"#C0C0C0"
/>
<
Setter
Property
=
"AlternatingBackground"
Value
=
"#C0C0C0"
/>
</
Style
>
Hope this helps. If you have any other questions, let us know.
Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Yevgeny
Top achievements
Rank 1
answered on 08 Jan 2014, 09:47 PM
Thank you very much, it's working.
I have another question:
I'm trying set background and border on rows on the TimeRuller part and on cells on the Grid part, but getting some weird result (see attachment). Here is my code:
Please help.
Regards,
Yevgeny
I have another question:
I'm trying set background and border on rows on the TimeRuller part and on cells on the Grid part, but getting some weird result (see attachment). Here is my code:
<
SolidColorBrush
x:Key
=
"GantBackgroundBrush"
Color
=
"#7c7c7c"
/>
<
SolidColorBrush
x:Key
=
"GantGridTitleBackgroundBrush"
Color
=
"#C0C0C0"
/>
<
SolidColorBrush
x:Key
=
"GantSelectedItemBrush"
Color
=
"#C0C0C0"
/>
<
SolidColorBrush
x:Key
=
"GantGridTitleForegroundBrush"
Color
=
"#3d3d3d"
/>
<
SolidColorBrush
x:Key
=
"GantRowBorderBrush"
Color
=
"#bbbbbb"
/>
<
SolidColorBrush
x:Key
=
"GantFontBrush"
Color
=
"#6d6c6c"
/>
<
SolidColorBrush
x:Key
=
"GantRowBackroundBrush"
Color
=
"#f4f4f4"
/>
<
Style
TargetType
=
"GanttView:ColumnHeaderContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantGridTitleForegroundBrush}"
/>
<
Setter
Property
=
"Background"
Value
=
"{DynamicResource GantGridTitleBackgroundBrush}"
/>
<
Setter
Property
=
"AlternatingBackground"
Value
=
"{DynamicResource GantGridTitleBackgroundBrush}"
/>
</
Style
>
<
Style
TargetType
=
"telerik:BorderContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantFontBrush}"
/>
<
Setter
Property
=
"Background"
Value
=
"{DynamicResource GantRowBackroundBrush}"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"{DynamicResource LangDict_GanttRowBorderSize}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{DynamicResource GantRowBorderBrush}"
/>
</
Style
>
<
Style
TargetType
=
"telerik:AlternatingBorderContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantFontBrush}"
/>
<
Setter
Property
=
"Background"
Value
=
"{DynamicResource GantRowBackroundBrush}"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"{DynamicResource LangDict_GanttRowBorderSize}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{DynamicResource GantRowBorderBrush}"
/>
</
Style
>
<
Style
TargetType
=
"GanttView:SimpleTreeCellContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantFontBrush}"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"{DynamicResource LangDict_GanttRowBorderSize}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{DynamicResource GantRowBorderBrush}"
/>
</
Style
>
<
Style
TargetType
=
"GanttView:SimpleCellContainer"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantFontBrush}"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"{DynamicResource LangDict_GanttRowBorderSize}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{DynamicResource GantRowBorderBrush}"
/>
</
Style
>
</
UserControl.Resources
>
<
Grid
>
<
Controls:RadGanttView
TasksSource
=
"{Binding QueueContext.Items}"
SelectedItem
=
"{Binding Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
FirstDayOfWeek
=
"Sunday"
PixelLength
=
"00:00:05"
ShowCurrentHourIndicator
=
"True"
HorizontalContentAlignment
=
"Stretch"
VerticalContentAlignment
=
"Stretch"
IsManipulationEnabled
=
"True"
VisibleRange
=
"{Binding Path=VisibleRange, Mode=OneWay}"
InitialExpandBehavior
=
"{StaticResource gntInitialExpandBehavior}"
Background
=
"{StaticResource GantBackgroundBrush}"
x:Name
=
"gntRun"
>
<
Controls:RadGanttView.Columns
>
<
GanttView:TreeColumnDefinition
Header
=
"Name"
MemberBinding
=
"{Binding Title}"
Width
=
"100"
/>
<
GanttView:ColumnDefinition
Header
=
"Status"
MemberBinding
=
"{Binding RunCode}"
Width
=
"50"
/>
<
GanttView:ColumnDefinition
Header
=
"Start Time"
MemberBinding
=
"{Binding StartTimeString}"
Width
=
"100"
/>
<
GanttView:ColumnDefinition
Header
=
"End Time"
MemberBinding
=
"{Binding EndTimeString}"
Width
=
"100"
/>
<
GanttView:ColumnDefinition
Header
=
"Duration"
MemberBinding
=
"{Binding Duration}"
Width
=
"50"
/>
</
Controls:RadGanttView.Columns
>
<
Controls:RadGanttView.TimeRulerLines
>
<
telerik:GroupTickLine
>
<
telerik:TickInterval
Interval
=
"OneDay"
/>
</
telerik:GroupTickLine
>
<
telerik:MajorTickLine
>
<
telerik:TickInterval
Interval
=
"OneHour"
/>
</
telerik:MajorTickLine
>
<
telerik:MinorTickLine
>
<
telerik:TickInterval
Interval
=
"OneMinute"
/>
</
telerik:MinorTickLine
>
</
Controls:RadGanttView.TimeRulerLines
>
</
Controls:RadGanttView
>
</
Grid
>
Please help.
Regards,
Yevgeny
0
Hello Yevgeny,
The desired appearance can be achieved by modifying the Style of the BorderContainers. You will need also set an opacity to 0.5 for example because the containers are overlapping when rendering and that is why you had some borders missing. I have attached a sample project which demonstrates the exact approach.
Hope this helps.
Regards,
Kalin
Telerik
The desired appearance can be achieved by modifying the Style of the BorderContainers. You will need also set an opacity to 0.5 for example because the containers are overlapping when rendering and that is why you had some borders missing. I have attached a sample project which demonstrates the exact approach.
Hope this helps.
Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Yevgeny
Top achievements
Rank 1
answered on 19 Jan 2014, 07:30 PM
Hi,
Thank you for your answer, but unfortunately suggested solution is not applicable for me because I have different GantView background and BorderContainer background, so when Opacity of BorderContainer is set to 50% for example, the BorderContainer Background is changed.
It looks like a bug, right?
Can you please suggest some workaround?
Thenk you,
Yevgeny
Thank you for your answer, but unfortunately suggested solution is not applicable for me because I have different GantView background and BorderContainer background, so when Opacity of BorderContainer is set to 50% for example, the BorderContainer Background is changed.
It looks like a bug, right?
Can you please suggest some workaround?
Thenk you,
Yevgeny
0
Hello Yevgeny,
I suggested you the approach with the opacity as it was the easiest one to be achieved. The difficulty with the cells styling is caused by way the GanttView gets drawn - firstly the rows are drawn then the columns and this is causing some Backgrounds overlapping between them which hides some of the borders you have set. However in order to achieve the desired you will need to extract the GanttItemsPresenterTemplate and set the Background of the VirtualizedGridPanel named VirtualizedGridPanel. After that you would only need to set the BorderBrushes of the BorderContainer and AlternatingBorderContainer. I have modified and attached the sample project in order to demonstrate the exact approach (note that I have used Implict Styles for styling the control).
Hope this will work for you.
Regards,
Kalin
Telerik
I suggested you the approach with the opacity as it was the easiest one to be achieved. The difficulty with the cells styling is caused by way the GanttView gets drawn - firstly the rows are drawn then the columns and this is causing some Backgrounds overlapping between them which hides some of the borders you have set. However in order to achieve the desired you will need to extract the GanttItemsPresenterTemplate and set the Background of the VirtualizedGridPanel named VirtualizedGridPanel. After that you would only need to set the BorderBrushes of the BorderContainer and AlternatingBorderContainer. I have modified and attached the sample project in order to demonstrate the exact approach (note that I have used Implict Styles for styling the control).
Hope this will work for you.
Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Yevgeny
Top achievements
Rank 1
answered on 22 Jan 2014, 03:46 PM
Hi,
Thank you for your answer.
I still have the same problem. I need same background on both sides of the control (Grid and TimeRuler), when BorderContainer background and AlternatingBorderContainer background are set, the problem is back.
It can be reproducible in your example from the last post:
Still looks like a bug or I'm missing something... Please advise.
Regards,
Yevgeny
Thank you for your answer.
I still have the same problem. I need same background on both sides of the control (Grid and TimeRuler), when BorderContainer background and AlternatingBorderContainer background are set, the problem is back.
It can be reproducible in your example from the last post:
<
Window.Resources
>
<
SolidColorBrush
x:Key
=
"GantBackgroundBrush"
Color
=
"#7c7c7c"
/>
<
SolidColorBrush
x:Key
=
"GantGridTitleBackgroundBrush"
Color
=
"#C0C0C0"
/>
<
SolidColorBrush
x:Key
=
"GantSelectedItemBrush"
Color
=
"#C0C0C0"
/>
<
SolidColorBrush
x:Key
=
"GantGridTitleForegroundBrush"
Color
=
"#3d3d3d"
/>
<
SolidColorBrush
x:Key
=
"GantRowBorderBrush"
Color
=
"#bbbbbb"
/>
<
SolidColorBrush
x:Key
=
"GantFontBrush"
Color
=
"#6d6c6c"
/>
<
SolidColorBrush
x:Key
=
"GantRowBackroundBrush"
Color
=
"#f4f4f4"
/>
<
Style
TargetType
=
"telerik:ColumnHeaderContainer"
BasedOn
=
"{StaticResource ColumnHeaderContainerStyle}"
>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource GantGridTitleForegroundBrush}"
/>
<
Setter
Property
=
"Background"
Value
=
"{DynamicResource GantGridTitleBackgroundBrush}"
/>
<
Setter
Property
=
"AlternatingBackground"
Value
=
"{DynamicResource GantGridTitleBackgroundBrush}"
/>
</
Style
>
<
ControlTemplate
x:Key
=
"GanttItemsPresenterTemplate"
TargetType
=
"telerik:GanttItemsPresenter"
>
<
telerik:GanttPresenterPanel
>
<
telerik:GanttPresenterPanel.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
MinWidth
=
"3"
/>
<
ColumnDefinition
Width
=
"3*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
telerik:GanttPresenterPanel.ColumnDefinitions
>
<
telerik:VirtualizedGridPanel
x:Name
=
"FrozenCellsPanel"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Top"
Margin
=
"4 -1 0 0"
telerik:GanttPresenterPanel.Column
=
"0"
telerik:GanttPresenterPanel.Area
=
"Content"
/>
<
telerik:TreeRenderingPanel
x:Name
=
"ColumnsPanel"
Orientation
=
"Horizontal"
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Header"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Stretch"
Margin
=
"-1 0 4 0"
/>
<!-- You need to change the background of this panel below-->
<
telerik:VirtualizedGridPanel
x:Name
=
"CellsPanel"
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Content"
Margin
=
"-1 -1 4 0"
Background
=
"{StaticResource GantRowBackroundBrush}"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
VerticalOffset
=
"{Binding VerticalOffset, ElementName=FrozenCellsPanel, Mode=TwoWay}"
HorizontalOffset
=
"{Binding HorizontalOffset, ElementName=ColumnsPanel, Mode=TwoWay}"
/>
<
telerik:TreeRenderingPanel
Orientation
=
"Horizontal"
x:Name
=
"FrozenColumnsPanel"
telerik:GanttPresenterPanel.Column
=
"0"
telerik:GanttPresenterPanel.Area
=
"Header"
Margin
=
"4 0 0 0"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
/>
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"ScrollBar"
Orientation
=
"Horizontal"
Minimum
=
"0"
Maximum
=
"{Binding ExtentWidth, ElementName=ColumnsPanel}"
Value
=
"{Binding HorizontalOffset, ElementName=ColumnsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportWidth, ElementName=ColumnsPanel}"
SmallChange
=
"40"
LargeChange
=
"{Binding ViewportWidth, ElementName=ColumnsPanel}"
Visibility
=
"{Binding CalculatedHorizontalScrollBarVisibility, ElementName=ColumnsPanel}"
/>
<
telerik:ResizeControl
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Splitter"
Style
=
"{StaticResource GanttPresenterSplitterStyle}"
/>
<
telerik:LogicalCanvasPanel
x:Name
=
"EventsPanel"
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"Content"
VerticalOffset
=
"{Binding VerticalOffset, ElementName=CellsPanel, Mode=TwoWay}"
Background
=
"Transparent"
Margin
=
"0 -1 0 0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
/>
<
telerik:LogicalCanvasPanel
x:Name
=
"TimeRulerPanel"
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"Header"
VerticalAlignment
=
"Bottom"
HorizontalAlignment
=
"Left"
Background
=
"Transparent"
HorizontalOffset
=
"{Binding HorizontalOffset, ElementName=EventsPanel, Mode=TwoWay}"
/>
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"ScrollBar"
Orientation
=
"Horizontal"
Minimum
=
"0"
Maximum
=
"{Binding ExtentWidth, ElementName=EventsPanel}"
Value
=
"{Binding HorizontalOffset, ElementName=EventsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportWidth, ElementName=EventsPanel}"
SmallChange
=
"20"
LargeChange
=
"{Binding ViewportWidth, ElementName=EventsPanel}"
Visibility
=
"{Binding CalculatedHorizontalScrollBarVisibility, ElementName=EventsPanel}"
/>
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"3"
telerik:GanttPresenterPanel.Area
=
"Content"
Orientation
=
"Vertical"
Minimum
=
"0"
Maximum
=
"{Binding ExtentHeight, ElementName=CellsPanel}"
Value
=
"{Binding VerticalOffset, ElementName=CellsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportHeight, ElementName=CellsPanel}"
Visibility
=
"{Binding CalculatedVerticalScrollBarVisibility, ElementName=CellsPanel}"
SmallChange
=
"10"
LargeChange
=
"{Binding ViewportHeight, ElementName=CellsPanel}"
/>
</
telerik:GanttPresenterPanel
>
</
ControlTemplate
>
<
Style
TargetType
=
"telerik:GanttItemsPresenter"
BasedOn
=
"{StaticResource GanttItemsPresenterStyle}"
>
<
Setter
Property
=
"Template"
Value
=
"{StaticResource GanttItemsPresenterTemplate}"
/>
</
Style
>
<
Style
TargetType
=
"telerik:BorderContainer"
BasedOn
=
"{StaticResource BorderContainerStyle}"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"{StaticResource GantRowBorderBrush}"
/>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource GantRowBackroundBrush}"
/>
</
Style
>
<
Style
TargetType
=
"telerik:AlternatingBorderContainer"
BasedOn
=
"{StaticResource AlternatingBorderContainerStyle}"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource GantRowBackroundBrush}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{StaticResource GantRowBorderBrush}"
/>
</
Style
>
</
Window.Resources
>
<
Grid
>
<
telerik:RadGanttView
x:Name
=
"ganttView"
Background
=
"{StaticResource GantBackgroundBrush}"
>
<
telerik:RadGanttView.Columns
>
<
telerik:TreeColumnDefinition
Header
=
"Name 1"
/>
<
telerik:TreeColumnDefinition
Header
=
"Name 2"
/>
<
telerik:TreeColumnDefinition
Header
=
"Name 3"
/>
<
telerik:TreeColumnDefinition
Header
=
"Name 4"
/>
<
telerik:TreeColumnDefinition
Header
=
"Name 5"
/>
</
telerik:RadGanttView.Columns
>
</
telerik:RadGanttView
>
</
Grid
>
Still looks like a bug or I'm missing something... Please advise.
Regards,
Yevgeny
0
Hi Yevgeny,
Yes, setting the Background properties of the BorderContainers and AlternatingBorderContainers causes the overlapping as I mentioned in my previous reply. The Background you need is in the GanttItemsPresenterTemplate again - you set it to set it to the panel named EventsPanel like shown below:
This will change the Background of the TimeRuller without affecting the cell.
Hope this helps. If you have any other questions let us know.
Regards,
Kalin
Telerik
Yes, setting the Background properties of the BorderContainers and AlternatingBorderContainers causes the overlapping as I mentioned in my previous reply. The Background you need is in the GanttItemsPresenterTemplate again - you set it to set it to the panel named EventsPanel like shown below:
<
telerik:LogicalCanvasPanel
x:Name
=
"EventsPanel"
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"Content"
VerticalOffset
=
"{Binding VerticalOffset, ElementName=CellsPanel, Mode=TwoWay}"
Background
=
"{StaticResource GantRowBackroundBrush}"
Margin
=
"0 -1 0 0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
/>
This will change the Background of the TimeRuller without affecting the cell.
Hope this helps. If you have any other questions let us know.
Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mark
Top achievements
Rank 1
answered on 12 Dec 2018, 06:57 AM
Hi,
I am using GanttItemsPresenterTemplate to change my ganttview resizecontrol style. It work fine.
But after I used highlightitemsource to highlight some tasks.Some Task's color didn't change after I click the row(see attachment).
What am I missing?
Thanks,
Mark
001.
<
telerik:RadGanttView
x:Name
=
"radGanttView"
002.
TimeLineVisualizationBehavior
=
"{Binding TimeLineCurrentlineBehavior}"
003.
TasksSource
=
"{Binding Tasks}"
004.
MouseDoubleClick
=
"RadGanttView_MouseDoubleClick"
005.
SelectedItem
=
"{Binding SelectedTask, Mode=TwoWay}"
006.
HighlightedItemsSource
=
"{Binding HighlightedItems, Mode=TwoWay}"
>
007.
<
telerik:RadGanttView.DragDropBehavior
>
008.
<
localGanttViewBehavior:CustomDragDropBehavior
/>
009.
</
telerik:RadGanttView.DragDropBehavior
>
010.
<
telerik:RadGanttView.DragDependenciesBehavior
>
011.
<
localGanttViewBehavior:CustomDragDependenciesBehavior
/>
012.
</
telerik:RadGanttView.DragDependenciesBehavior
>
013.
<
telerik:RadGanttView.Resources
>
014.
<
ResourceDictionary
>
015.
<
ResourceDictionary.MergedDictionaries
>
016.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.GanttView.xaml"
/>
017.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml"
/>
018.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml"
/>
019.
</
ResourceDictionary.MergedDictionaries
>
020.
<
localGanttViewBehavior:CellInfoToBrushConverter
x:Key
=
"cellInfoToBrushConverter"
/>
021.
<
localGanttViewBehavior:CellInfoToFontWeightConverter
x:Key
=
"cellInfoToFontWeightConverter"
/>
022.
<
DataTemplate
x:Key
=
"CriticalPathTemplate"
>
023.
<
TextBlock
Text
=
"{Binding FormattedValue}"
FontWeight
=
"{Binding CellInfo.DataItem, Converter={StaticResource cellInfoToFontWeightConverter}}"
Foreground
=
"{Binding CellInfo.DataItem, Converter={StaticResource cellInfoToBrushConverter}}"
VerticalAlignment
=
"Center"
/>
024.
</
DataTemplate
>
025.
<
ControlTemplate
x:Key
=
"EventDecoratorContainerTemplate"
TargetType
=
"telerik:EventDecoratorContainer"
/>
026.
<
ControlTemplate
x:Key
=
"MyDependencyIndicatorTemplate"
TargetType
=
"telerik:DependencyIndicator"
/>
027.
<
Style
TargetType
=
"telerik:EventContainer"
BasedOn
=
"{StaticResource EventContainerStyle}"
>
028.
<
Setter
Property
=
"localGanttViewBehavior:GanttTaskClickExtension.ClickCount"
029.
Value
=
"1"
/>
030.
<
Setter
Property
=
"localGanttViewBehavior:GanttTaskClickExtension.CommandParameter"
031.
Value
=
"{Binding OriginalEvent}"
/>
032.
<
Setter
Property
=
"localGanttViewBehavior:GanttTaskClickExtension.Command"
033.
Value
=
"{Binding Path=DataContext.SingleClickCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerik:RadGanttView}}"
/>
034.
</
Style
>
035.
<
Style
TargetType
=
"telerik:EventDecoratorContainer"
BasedOn
=
"{StaticResource EventDecoratorContainerStyle}"
>
036.
<
Setter
Property
=
"Template"
Value
=
"{StaticResource EventDecoratorContainerTemplate}"
/>
037.
</
Style
>
038.
<
Style
x:Key
=
"DependencyIndicatorStyle"
TargetType
=
"telerik:DependencyIndicator"
>
039.
<
Setter
Property
=
"Template"
Value
=
"{StaticResource MyDependencyIndicatorTemplate}"
/>
040.
<
Setter
Property
=
"telerik:DragDropManager.TouchDragTrigger"
Value
=
"TapAndHold"
/>
041.
</
Style
>
042.
<
SolidColorBrush
x:Key
=
"ResizerFill"
Color
=
"#B2277FFF"
/>
043.
<
SolidColorBrush
x:Key
=
"ResizerStroke"
Color
=
"#FF848484"
/>
044.
<
Style
TargetType
=
"telerik:ResizeControl"
x:Key
=
"GanttPresenterSplitterStyle"
>
045.
<
Setter
Property
=
"Background"
Value
=
"#1E1E1E"
/>
046.
<
Setter
Property
=
"BorderThickness"
Value
=
"1 0 1 0"
/>
047.
<
Setter
Property
=
"IsTabStop"
Value
=
"True"
/>
048.
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Right"
/>
049.
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Stretch"
/>
050.
<
Setter
Property
=
"telerik:ZIndexManager.ZIndex"
Value
=
"100"
/>
051.
<
Setter
Property
=
"ShowsPreview"
Value
=
"True"
/>
052.
<
Setter
Property
=
"BorderBrush"
Value
=
"#3F3F46"
/>
053.
<
Setter
Property
=
"Width"
Value
=
"16"
/>
054.
<
Setter
Property
=
"Template"
>
055.
<
Setter.Value
>
056.
<
ControlTemplate
TargetType
=
"telerik:ResizeControl"
>
057.
<
Grid
x:Name
=
"Root"
IsHitTestVisible
=
"{TemplateBinding IsEnabled}"
>
058.
<
VisualStateManager.VisualStateGroups
>
059.
<
VisualStateGroup
x:Name
=
"CommonStates"
>
060.
<
VisualState
x:Name
=
"Normal"
/>
061.
<
VisualState
x:Name
=
"MouseOver"
/>
062.
<
VisualState
x:Name
=
"Disabled"
/>
063.
</
VisualStateGroup
>
064.
<
VisualStateGroup
x:Name
=
"FocusStates"
>
065.
<
VisualState
x:Name
=
"Unfocused"
/>
066.
<
VisualState
x:Name
=
"Focused"
/>
067.
</
VisualStateGroup
>
068.
</
VisualStateManager.VisualStateGroups
>
069.
<
Border
Width
=
"{TemplateBinding Width}"
VerticalAlignment
=
"{TemplateBinding VerticalAlignment}"
HorizontalAlignment
=
"{TemplateBinding HorizontalAlignment}"
Background
=
"{TemplateBinding Background}"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
/>
070.
<
Rectangle
x:Name
=
"FocusedVisual"
Stroke
=
"{StaticResource ResizerStroke}"
StrokeThickness
=
"1"
StrokeDashArray
=
"2 2"
Margin
=
"0 0 -1 0"
Opacity
=
"0"
/>
071.
<
Rectangle
x:Name
=
"PART_PreviewControl"
VerticalAlignment
=
"Stretch"
HorizontalAlignment
=
"Stretch"
Fill
=
"{StaticResource ResizerFill}"
Opacity
=
"0.5"
Visibility
=
"Collapsed"
/>
072.
</
Grid
>
073.
</
ControlTemplate
>
074.
</
Setter.Value
>
075.
</
Setter
>
076.
</
Style
>
077.
<
Style
TargetType
=
"telerik:GanttItemsPresenter"
>
078.
<
Setter
Property
=
"Background"
Value
=
"Transparent"
/>
079.
<
Setter
Property
=
"Template"
>
080.
<
Setter.Value
>
081.
<
ControlTemplate
TargetType
=
"telerik:GanttItemsPresenter"
>
082.
<
telerik:GanttPresenterPanel
>
083.
<
telerik:GanttPresenterPanel.ColumnDefinitions
>
084.
<
ColumnDefinition
Width
=
"Auto"
/>
085.
<
ColumnDefinition
Width
=
"50*"
MinWidth
=
"3"
/>
086.
<
ColumnDefinition
Width
=
"50*"
/>
087.
<
ColumnDefinition
Width
=
"Auto"
/>
088.
</
telerik:GanttPresenterPanel.ColumnDefinitions
>
089.
<
telerik:VirtualizedGridPanel
x:Name
=
"FrozenCellsPanel"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Top"
Margin
=
"4 -1 0 0"
telerik:GanttPresenterPanel.Column
=
"0"
telerik:GanttPresenterPanel.Area
=
"Content"
/>
090.
<
telerik:VirtualizedGridPanel
x:Name
=
"CellsPanel"
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Content"
Margin
=
"-1 -1 4 0"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
VerticalOffset
=
"{Binding VerticalOffset, ElementName=FrozenCellsPanel, Mode=TwoWay}"
HorizontalOffset
=
"{Binding HorizontalOffset, ElementName=ColumnsPanel, Mode=TwoWay}"
/>
091.
<
telerik:TreeRenderingPanel
x:Name
=
"ColumnsPanel"
Orientation
=
"Horizontal"
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Header"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Stretch"
Margin
=
"-1 0 4 0"
/>
092.
<
telerik:TreeRenderingPanel
Orientation
=
"Horizontal"
x:Name
=
"FrozenColumnsPanel"
telerik:GanttPresenterPanel.Column
=
"0"
telerik:GanttPresenterPanel.Area
=
"Header"
Margin
=
"4 0 0 0"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
/>
093.
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"ScrollBar"
Orientation
=
"Horizontal"
Minimum
=
"0"
Maximum
=
"{Binding ExtentWidth, ElementName=ColumnsPanel}"
Value
=
"{Binding HorizontalOffset, ElementName=ColumnsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportWidth, ElementName=ColumnsPanel}"
SmallChange
=
"40"
LargeChange
=
"{Binding ViewportWidth, ElementName=ColumnsPanel}"
Visibility
=
"{Binding CalculatedHorizontalScrollBarVisibility, ElementName=ColumnsPanel}"
/>
094.
<
telerik:ResizeControl
telerik:GanttPresenterPanel.Column
=
"1"
telerik:GanttPresenterPanel.Area
=
"Splitter"
Style
=
"{StaticResource GanttPresenterSplitterStyle}"
/>
095.
<
telerik:LogicalCanvasPanel
x:Name
=
"EventsPanel"
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"Content"
VerticalOffset
=
"{Binding VerticalOffset, ElementName=CellsPanel, Mode=TwoWay}"
Background
=
"Transparent"
Margin
=
"0 -1 0 0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
/>
096.
<
telerik:LogicalCanvasPanel
x:Name
=
"TimeRulerPanel"
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"Header"
VerticalAlignment
=
"Bottom"
HorizontalAlignment
=
"Left"
Background
=
"Transparent"
HorizontalOffset
=
"{Binding HorizontalOffset, ElementName=EventsPanel, Mode=TwoWay}"
/>
097.
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"2"
telerik:GanttPresenterPanel.Area
=
"ScrollBar"
Orientation
=
"Horizontal"
Minimum
=
"0"
Maximum
=
"{Binding ExtentWidth, ElementName=EventsPanel}"
Value
=
"{Binding HorizontalOffset, ElementName=EventsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportWidth, ElementName=EventsPanel}"
SmallChange
=
"20"
LargeChange
=
"{Binding ViewportWidth, ElementName=EventsPanel}"
Visibility
=
"{Binding CalculatedHorizontalScrollBarVisibility, ElementName=EventsPanel}"
/>
098.
<
ScrollBar
telerik:GanttPresenterPanel.Column
=
"3"
telerik:GanttPresenterPanel.Area
=
"Content"
Orientation
=
"Vertical"
Minimum
=
"0"
Maximum
=
"{Binding ExtentHeight, ElementName=CellsPanel}"
Value
=
"{Binding VerticalOffset, ElementName=CellsPanel, Mode=TwoWay}"
ViewportSize
=
"{Binding ViewportHeight, ElementName=CellsPanel}"
Visibility
=
"{Binding CalculatedVerticalScrollBarVisibility, ElementName=CellsPanel}"
SmallChange
=
"10"
LargeChange
=
"{Binding ViewportHeight, ElementName=CellsPanel}"
/>
099.
</
telerik:GanttPresenterPanel
>
100.
</
ControlTemplate
>
101.
</
Setter.Value
>
102.
</
Setter
>
103.
</
Style
>
104.
105.
<
Style
TargetType
=
"telerik:SimpleCellContainer"
BasedOn
=
"{StaticResource SimpleCellContainerStyle}"
>
106.
<
Setter
Property
=
"MinHeight"
Value
=
"35"
/>
107.
</
Style
>
108.
109.
<
Style
TargetType
=
"telerik:CellContainer"
BasedOn
=
"{StaticResource CellContainerStyle}"
>
110.
<
Setter
Property
=
"MinHeight"
Value
=
"35"
/>
111.
</
Style
>
112.
113.
<
Style
TargetType
=
"telerik:CellEditingContainer"
BasedOn
=
"{StaticResource CellEditingContainerStyle}"
>
114.
<
Setter
Property
=
"MinHeight"
Value
=
"35"
/>
115.
</
Style
>
116.
117.
<
Style
TargetType
=
"telerik:TreeCellContainer"
BasedOn
=
"{StaticResource TreeCellContainerStyle}"
>
118.
<
Setter
Property
=
"MinHeight"
Value
=
"35"
/>
119.
</
Style
>
120.
121.
<!--<
Style
TargetType
=
"telerik:SimpleTreeCellContainer"
BasedOn
=
"{StaticResource SimpleTreeCellContainerStyle}"
>
122.
<
Setter
Property
=
"Padding"
Value
=
"0 0 5 0"
/>
123.
<
Setter
Property
=
"MinHeight"
Value
=
"35"
/>
124.
<
Setter
Property
=
"Template"
>
125.
<
Setter.Value
>
126.
<
ControlTemplate
TargetType
=
"Control"
>
127.
<
Border
Background
=
"{TemplateBinding Background}"
BorderThickness
=
"0"
Margin
=
"{TemplateBinding Padding}"
>
128.
<
Grid
x:Name
=
"TemplateRootVisual"
129.
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
130.
Background
=
"{TemplateBinding Background}"
131.
VerticalAlignment
=
"{TemplateBinding VerticalAlignment}"
>
132.
<
Grid.ColumnDefinitions
>
133.
<
ColumnDefinition
Width
=
"20"
/>
134.
<
ColumnDefinition
Width
=
"*"
/>
135.
</
Grid.ColumnDefinitions
>
136.
<
Border
x:Name
=
"PART_ExpandCollapseHitArea"
MinHeight
=
"15"
Background
=
"Transparent"
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
>
137.
<
Path
x:Name
=
"PART_ExpandCollapseVisual"
138.
StrokeThickness
=
"1"
139.
RenderTransformOrigin
=
"0.5,0.5"
140.
Stretch
=
"Fill"
141.
Data
=
"M0.5,0.5 L5.2,5.4 L5.2,5.4 L0.5,10.5 z"
142.
Width
=
"6"
143.
Height
=
"9"
144.
VerticalAlignment
=
"Stretch"
145.
HorizontalAlignment
=
"Stretch"
146.
IsHitTestVisible
=
"False"
147.
Margin
=
"-4 0 0 0"
/>
148.
</
Border
>
149.
<
TextBlock
Grid.Column
=
"1"
x:Name
=
"ValueTextBlock"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
Foreground
=
"{Binding Path=DataItem, Converter={StaticResource cellInfoToBrushConverter}, RelativeSource={RelativeSource AncestorType=telerik:SimpleTreeCellContainer}}"
/>
150.
</
Grid
>
151.
</
Border
>
152.
</
ControlTemplate
>
153.
</
Setter.Value
>
154.
</
Setter
>
155.
</
Style
>-->
156.
157.
<
Style
TargetType
=
"telerik:RelationContainer"
BasedOn
=
"{StaticResource RelationContainerStyle}"
>
158.
<
Setter
Property
=
"Margin"
Value
=
"0 17 0 17"
/>
159.
</
Style
>
160.
161.
<
Style
TargetType
=
"telerik:DragRelationSlotContainer"
BasedOn
=
"{StaticResource DragRelationSlotClontainerStyle}"
>
162.
<
Setter
Property
=
"Margin"
Value
=
"0 17 0 17"
/>
163.
</
Style
>
164.
165.
</
ResourceDictionary
>
166.
</
telerik:RadGanttView.Resources
>
167.
<
telerik:RadGanttView.TimelineContainerSelector
>
168.
<
local:TimeLineCurrentlineContainerSelector
/>
169.
</
telerik:RadGanttView.TimelineContainerSelector
>
170.
<
telerik:RadGanttView.TimeRulerLines
>
171.
<
telerik:GroupTickLine
>
172.
<
telerik:TickInterval
Interval
=
"OneYear"
/>
173.
</
telerik:GroupTickLine
>
174.
<
telerik:MajorTickLine
>
175.
<
telerik:TickInterval
Interval
=
"OneMonth"
/>
176.
</
telerik:MajorTickLine
>
177.
</
telerik:RadGanttView.TimeRulerLines
>
178.
<
telerik:RadGanttView.Columns
>
179.
<
telerik:TreeColumnDefinition
Header
=
"工作項目"
MemberBinding
=
"{Binding Title}"
Width
=
"200"
CellTemplate
=
"{StaticResource CriticalPathTemplate}"
/>
180.
<
telerik:ColumnDefinition
Header
=
"開始日期"
MemberBinding
=
"{Binding Start, StringFormat='{}{0:yyyy/MM/dd}',ConverterCulture=en-GB}"
Width
=
"90"
CellTemplate
=
"{StaticResource CriticalPathTemplate}"
/>
181.
<
telerik:ColumnDefinition
Header
=
"結束日期"
MemberBinding
=
"{Binding End, StringFormat='{}{0:yyyy/MM/dd}',ConverterCulture=en-GB}"
Width
=
"90"
CellTemplate
=
"{StaticResource CriticalPathTemplate}"
/>
182.
</
telerik:RadGanttView.Columns
>
183.
</
telerik:RadGanttView
>
0
Hello Mark,
If you remove the GanttItemsPresenter template - do you still observe the described behavior? I'm investigating the snippet and will let you know if I find anything incorrect, meanwhile can you please also let me know the exact version of Telerik UI for WPF that you are using?
I'm looking forward to hearing from you.
Regards,
Kalin
Progress Telerik
If you remove the GanttItemsPresenter template - do you still observe the described behavior? I'm investigating the snippet and will let you know if I find anything incorrect, meanwhile can you please also let me know the exact version of Telerik UI for WPF that you are using?
I'm looking forward to hearing from you.
Regards,
Kalin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mark
Top achievements
Rank 1
answered on 18 Dec 2018, 11:06 AM
Hi Kalin,
Once I removed the GanttItemsPresenter template the problem is well solved.
And my version of Telerik UI for WPF is 2018.2.620.45.
Thanks,
Mark
0
Hello Mark,
At first sight the template seems okay. Would it be possible to isolate this in a sample project and share it here? This will give me a better idea of your exact set up and plotted data, and I can check what is going on.
Regards,
Martin Ivanov
Progress Telerik
At first sight the template seems okay. Would it be possible to isolate this in a sample project and share it here? This will give me a better idea of your exact set up and plotted data, and I can check what is going on.
Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.