Hi
I am trying to Display a Summary Field on a Group Caption.
The Data Source is a Data Table;
When I Group on a Field (Cattle) and then total the values and display;
the values sent to the datatable are INT but i have tried string also,
I have also tried various string formats but am unsure ?
When i swicth to a count it works and displays the number of rows in each group.
I think i am missing something simple
----------------------------------------------------------------
//Created Data Table
DataTable dt = new DataTable();
dt.Columns.Add("Cattle");
dt.Columns.Add("Name");
dt.Columns.Add("CountAnimals");
DataRow r = dt.NewRow();
r["Cattle"] = "1.Cows (Dairy & Suckler)";
r["Name"] = "Dairy Cows";
r["CountAnimals"] = dairyc; //INT
dt.Rows.Add(r);
r = dt.NewRow();
r["Cattle"] = "1.Cows (Dairy & Suckler)";
r["Name"] = "Suckler Cows";
r["CountAnimals"] = sucklerC; //INT
dt.Rows.Add(r);
r = dt.NewRow();
r["Cattle"] = "6.Other";
r["Name"] = "Breeding Bulls";
r["CountAnimals"] = breedingBull; //INT
dt.Rows.Add(r);
----------------------------------------------------------------------------------------
//grouping
StockInfoView.DataSource = GetStockInfoDataTable(DateTime.Now);
StockInfoView.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "Cattle" });
StockInfoView.Columns[0].Visible = false;
StockInfoView.CaptionSummaryRow = new GridSummaryRow()
{
Name = "CaptionSummary",
ShowSummaryInRow = true,
Title = "{Key} : {CaptionSummaryColumn}",
SummaryColumns = new ObservableCollection<ISummaryColumn>()
{
new GridSummaryColumn()
{
MappingName = "CountAnimals",
Format="{Sum:c}", //have tried {Sum:d} {Sum}
SummaryType= SummaryType.DoubleAggregate, //have tried INT
Name = "CaptionSummaryColumn",
}
},
};
---------------------------------------------------------------------------------------------------------------------------------
What am I doing wrong ?
Peter ?