hi team
im using dropdown list and grid
When an item is selected from the drop-down list, the grid data source fill with data
this is good but
When we make aggregate columns dynamic,it throw an exception:
System.ArgumentException: An item with the same key has already been added. Key: S9.Pressure.Value
Is there a way to check if the key exists in the collection?
Or Reset aggregate columns items?
<GridAggregates>
<GridAggregate>
<GridAggregateColumns>
@if (Aggerate != null)
{
foreach (var col in Aggerate.Columns)
{
var pressure = "S" + col.Key.ToString() + ".Pressure.Value";
<GridAggregateColumn Field="@pressure" Type="AggregateType.Average">
</GridAggregateColumn>
}
}
}
</GridAggregateColumns>
</GridAggregate>
</GridAggregates>