public bool ShouldStartNewGroup(IList<CellData> rowCellsData)
{
if (!SharedData.IsGroupingEnabled) return false;
if (CurrentRowInfoData.LastOverallDataRowNumber == 1)
{
updateLastRowValues(rowCellsData);
return true;
}
foreach (var property in SharedData.GroupByProperties)
{
var currentCellValue = getCurrentCellValue(rowCellsData, property);
object lastRowCellValue;
if (_currentRowValues.TryGetValue(property, out lastRowCellValue))
{
if (!areEqual(lastRowCellValue, currentCellValue, property))
{
_currentRowValues.Clear();
updateLastRowValues(rowCellsData);
return true;
}
}
else
{
_currentRowValues.Add(new KeyValuePair<string, object>(property, currentCellValue));
}
}
return false;
}