this.AssociatedObject.GanttGrid.InternalGrid.UnboundRowPosition = Position.Bottom;
this.AssociatedObject.GanttGrid.InternalGrid.UnboundRowsCount = 3;
this.AssociatedObject.GanttGrid.InternalGrid.QueryCellInfo += InternalGrid_QueryCellInfo;
this.AssociatedObject.GanttGrid.InternalGrid.QueryCoveredRange += InternalGrid_QueryCoveredRange;
void InternalGrid_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
var rowcolIndex = e.CellRowColumnIndex;
if (rowcolIndex.ColumnIndex >= 1)
{
var unboundPos = this.AssociatedObject.GanttGrid.InternalGrid.ResolveIndexToUnboundRowPosition(rowcolIndex.RowIndex);
if (unboundPos >= 0 && unboundPos < this.AssociatedObject.GanttGrid.InternalGrid.UnboundRowsCount)
{
e.Range = new Syncfusion.Windows.Controls.Cells.CoveredCellInfo(rowcolIndex.RowIndex, 1, rowcolIndex.RowIndex, this.AssociatedObject.GanttGrid.InternalGrid.Model.ColumnCount - 1);
e.Handled = true;
}
}
}
void InternalGrid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.Style.Tag != null && e.Style.Tag.Equals("UnboundRow") && e.Style.ColumnIndex == 1)
{
int total = GetViewModel.Planning.SelectMany(p => p.SubItems).Where(p => p.IsPlanningVisible).Count();
var unboundPos = this.AssociatedObject.GanttGrid.InternalGrid.ResolveIndexToUnboundRowPosition(e.Style.RowIndex);
if (unboundPos == 0)
e.Style.CellValue = "_attivi : " + total;
else if (unboundPos == 1)
e.Style.CellValue = "_magazzino : " + 3;
else if (unboundPos == 2)
e.Style.CellValue = "_archivio: " + 3;
e.Style.Background = new SolidColorBrush(GridUtil.GetXamlConvertedValue<Color>("#FFA9C1DE"));
e.Style.Foreground = new SolidColorBrush(GridUtil.GetXamlConvertedValue<Color>("#FF1E395B"));
e.Style.ReadOnly = true;
}
}
The code is for the most part took from the example behavior class, and I've tryed both with and without .InternalGrid, amI doing something wrong? Or the GanttControl is just not meant to have UnboundRows?
Cheers
Antoine
this.AssociatedObject.GanttGrid.InternalGrid.FooterRows = 3;