Пример #1
0
        protected void ASPxLabel1_Load(object sender, EventArgs e)
        {
            ASPxGridView       grid    = ASPxGridView1;
            GridViewDataColumn col     = grid.Columns["UnitsInStock"] as GridViewDataColumn;
            ASPxSummaryItem    summary = grid.TotalSummary["UnitsInStock", DevExpress.Data.SummaryItemType.Sum];
            string             text    = summary.GetTotalFooterDisplayText(col, grid.GetTotalSummaryValue(summary));
            ASPxLabel          label   = (ASPxLabel)sender;

            label.Text = string.Format("{0}\r\n({1})", col.FieldName, text);
        }
Пример #2
0
    protected virtual ASPxLabel CreateSummaryItemControl(ASPxSummaryItem item, ASPxGridView grid)
    {
        var value = grid.GetTotalSummaryValue(item);
        var text  = item.GetTotalFooterDisplayText(grid.DataColumns[item.FieldName], value);

        var label = new ASPxLabel();

        label.EnableClientSideAPI = true;
        label.ID    = string.Format("SummaryItemControl_{0}_{1}", item.FieldName, item.ShowInColumn);
        label.Text  = text;
        label.Init += (s, e) => { SummaryTexts[label.ClientID] = label.Text; };

        return(label);
    }