BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void Gantt_OnLoaded(object sender, RoutedEventArgs e)
{
ObservableCollection<double> RiskPercent = new ObservableCollection<double>();
RiskPercent.Add(10);
RiskPercent.Add(20);
RiskPercent.Add(30);
RiskPercent.Add(40);
RiskPercent.Add(50);
RiskPercent.Add(60);
RiskPercent.Add(70);
RiskPercent.Add(80);
RiskPercent.Add(90);
// Creating a new custom column with combo box
GridTreeColumn riskColumn = new GridTreeColumn
{
MappingName = "RiskPercentage",
HeaderText = "Risk",
Width = 120,
StyleInfo = new GridStyleInfo
{
CellType = "ComboBox",
ItemsSource = RiskPercent,
HorizontalAlignment =
HorizontalAlignment
.Center,
VerticalAlignment =
VerticalAlignment
.Center
}
};
this.Gantt.GanttGrid.InternalGrid.DropDownSelectionChanged += InternalGrid_DropDownSelectionChanged;
this.Gantt.GanttGrid.Columns.Insert(2, riskColumn);
}
private void InternalGrid_DropDownSelectionChanged(object sender, GridCellComboValueChangedEventArgs args)
{
GridTreeNode node = this.Gantt.GanttGrid.InternalGrid.GetNodeAtRowIndex(args.CellRowColumnIndex.RowIndex);
int risk;
if (node != null && node.Item != null)
{
if (int.TryParse(args.SelectedItem as string, out risk))
{
(node.Item as Task).RiskPercentage = risk;
}
}
} |