반응형
Event Container
일반적인 Task 표시 블럭
데이터 입력
XAML
<telerik:RadGanttView
x:Name="ganttView"
TasksSource="{Binding GanttTasks}"
>
<telerik:RadGanttView.Columns>
<telerik:TreeColumnDefinition MemberBinding="{Binding Title}" IsFrozenColumn="True" Header="Title" Width="AutoHeaderAndContent"/>
<telerik:ColumnDefinition MemberBinding="{Binding Start}" Header="Start" Width="AutoHeaderAndContent"/>
<telerik:ColumnDefinition MemberBinding="{Binding End}" Header="End" Width="AutoHeaderAndContent"/>
</telerik:RadGanttView.Columns>
</telerik:RadGanttView>
Code
public ObservableCollection<GanttTask> GanttTasks { get; set; }
private void SetGantt()
{
// 2021-08-01 ~ 2021-08-02
// Title : Task 1
var task1 = new GanttTask(new DateTime(2021, 08, 01), new DateTime(2021, 08, 02), "Task 1");
// 2021-08-01 ~ 2021-08-03
// Title : Task 2
var task2 = new GanttTask(new DateTime(2021, 08, 01), new DateTime(2021, 08, 03), "Task 2");
this.GanttTasks = new ObservableCollection<GanttTask>() { task1, task2 };
}
Style
<Style TargetType="telerik:EventContainer">
<Setter Property="FontSize" Value="12"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="gray"/>
</Trigger>
<Trigger Property="IsMouseOverHighlighted" Value="True">
<Setter Property="Background" Value="Aqua"/>
</Trigger>
</Style.Triggers>
</Style>
반응형