This is a migrated thread and some comments may be shown as answers.

Missing EvaluateAggregate in GridViewSummaryItem

1 Answer 168 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 16 Jul 2010, 08:44 AM
1:
In Q2 2010 there is no Method like EvaluateAggregate in SummaryItem. I need this method to implement SummaryAggregates like Sum / 4.0.

How can i implement this feature in Q2 ?

2:
Now i see ColumnIndexChanging is obsolete. I need column reordering only for columns with index > 3 for Example. How do i implement this now? --> Solved: Using Columns.CollectionChanging
Edit:
CollectionChanging/Changed solved not the problem. These events are fired 2 times for 1 column reordering (remove and add). in these events i dont see the new or the old index at the same time. Any solutions?

3:
How do i pin a SummaryItem?

4:
GridViewSummaryItem is not working anymore.

Example:

GridViewDataColumn column = new GridViewDecimalColumn("880", "880");
column.FormatString = "{0:N2}";
GridViewSummaryItem summaryItem = new GridViewSummaryItem(column.UniqueName, column.FormatString, GridAggregateFunction.Sum);
this.summaryRow.Add(summaryItem);

The Summary with 96 rows is 96 * 880. Min or Max is 880.

What is wrong here?

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 20 Jul 2010, 06:55 AM
Hello Thomas,

Thank you for contacting us. Regarding your questions:

1. You can create a summary item with Sum / 4.0 expression using the AggregateExpression introduced in Q2 2010 release:

GridViewSummaryItem summaryItem = new GridViewSummaryItem("ColumnName", "Result: {0}", "Sum(ColumnName)/4.0");

2. Columns.CollectionChanging is the event which is meant to replace the ColumnIndexChanging event. Unfortunately in your scenario its new behavior causes the issue you describe. We will consider better behavior for the columns reording case.

3. You can pin a GridViewSummaryRowInfo which represends the GridViewSummaryRowItem. The last one holds the GridViewSummaryItem-s. You can access the summary rows trough the GridViewInfo which contains information for the visual presentation of the rows in a given GridViewTemplate.

this.radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Top;

4. The GridViewSummaryItem, created by using the code from your example, generates the following expression - Sum(880). It is done from the assigned GridAggregateFunction and the name of the column. In the given example it is not correct because it assumes that the given value 880 is a number and not a column name.
As a workaround you can set the Name (was UniqueName) of the column to a value which is not a number or contains system characters.

Thank you for pointing us the issues from questions 2 and 4. We will address them in a next version. I have updated your Telerik points for the valuable feedback.

Kind regards,
Alexander
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or