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

Server-side / auto-column aggregating?

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 03 Nov 2008, 06:56 PM
Hi.

I seem to be a little lost.

I have a dynamically-generated datasource for my RadGrid, with AutoGenerateColumns=true.  In all columns but one, I'd like to sum the column.

I'm not seeing access to the GridColumn.Aggregate property on the server side, or any means to indicate that I wish to aggregate my auto-generated columns on the front end.  I'm sure something is there, but I'm not finding it.

Thanks in advance.

John

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Nov 2008, 06:01 AM
Hi John,

Try accessing the AutoGeneratedColumns in the Column Created event as shown below.

CS:
 protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if ((e.Column is GridBoundColumn)&&(e.Column.UniqueName=="ProductName")) 
        { 
            GridBoundColumn bounCol = (GridBoundColumn)e.Column; 
            bounCol.Aggregate = GridAggregateFunction.Count; 
        } 
         
    } 


Thanks
Shinu.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or