<ig:XamGantt x:Name="gantt"
Project="{Binding Project}"
ActiveCellChanged="gantt_ActiveCellChanged"/>
This topic describes the properties and events used to set or retrieve the currently active cell, column or row in the xamGantt™ control.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The following table lists the configurable aspects and corresponding properties for setting and retrieving the active element in the xamGantt control.
The following table identifies the event to set and retrieve the active element in the xamGantt control.
The code snippet demonstrates how to use the xamGantt ActiveCellChanged
event to identify the currently active task and its name. Every time you select or click in a xamGantt cell, you automatically trigger the ActiveCellChanged event.
In XAML:
<ig:XamGantt x:Name="gantt"
Project="{Binding Project}"
ActiveCellChanged="gantt_ActiveCellChanged"/>
In C#:
private void gantt_ActiveCellChanged(object sender, System.EventArgs e)
{
if (this.gantt.ActiveRow.HasValue)
{
string msg = string.Format("The current active task is {0}.",this.gantt.ActiveRow.Value.Task.TaskName);
System.Diagnostics.Debug.WriteLine(msg);
}
}
In Visual Basic:
Private Sub gantt_ActiveCellChanged(sender As System.Object, e As System.EventArgs)
If Me.gantt.ActiveRow.HasValue Then
Dim msg As String = String.Format("The current active task is {0}.", Me.gantt.ActiveRow.Value.Task.TaskName)
System.Diagnostics.Debug.WriteLine(msg)
End If
End Sub
The following topics provide additional information related to this topic.