【问题标题】:Problems getting agregate functions' values with RadTreeListView's column.getaggregateresults()使用 RadTreeListView column.getaggregate results() 获取聚合函数值的问题
【发布时间】:2015-01-21 10:00:46
【问题描述】:

我正在使用 Count AggregateFunction,我想从后面的代码中访问它的值。可以使用函数getaggregateresults(QueryableCollectionViewGroup group) 管理此任务,但我在访问QueryableCollectionViewGroup 对象时遇到问题,因为它的构造函数受到保护。

这是我正在使用的代码:

   <GridViewDataColumn  UniqueName="NameHeader">                   
                <telerik:GridViewDataColumn.AggregateFunctions>
                    <telerik:CountFunction Caption="Count: " />
                </telerik:GridViewDataColumn.AggregateFunctions>
    </GridViewDataColumn>`

函数调用如下:

this.RadTreeListView.Columns["NameHeader"].GetAggregateResults(QUERYABLEGROUP).ElementAt(0).FormattedValue;

我将不胜感激。

提前致谢。

【问题讨论】:

    标签: silverlight telerik aggregate-functions radtreelist


    【解决方案1】:

    当 RadTreeListView.DataLoaded 事件发生时,我已经设法检索到执行此函数的答案:

        void UnselectedItemsDataGrid_DataLoaded(object sender, EventArgs e)
        {  
            var s = (RadTreeListView)sender;
            s.CalculateAggregates();
            AggregateResult result = s.AggregateResults[0];
        }
    

    RadTreeListView 仅具有 Count 聚合函数,因此它始终位于索引 0 处。结果包装在 AggregateResult 上。此代码是一个示例,但它照亮了解决方案的路径。

    如果有人遇到同样的问题,我希望这个答案能够提供帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-08
      • 2022-06-29
      • 2017-06-04
      • 1970-01-01
      相关资源
      最近更新 更多