Search code examples
c#vb.netdevexpressxtragrid

Clear TOTAL summaryItem - devexpress


How can i remove all total summryItem at once

gridview1.Columns("Column1").SummaryItem.Collection.Remove(ItemVariable)

I try this and it works but is there any way I can delete all Collection like using something like this:

 gridview1.TotalSummaryItemCollection.remove ???

Solution

  • There are no TotalSummaryItemCollection for each TotalSummaryItem in each GridColumn. There are only GridColumn.Summary property of class GridColumnSummaryItemCollection. This property have the Clear method, which allows you to delete all TotalSummaryItems from GridColumn. So, to remove all TotalSummaryItems you must use something like this:

    foreach (GridColumn gridColumn in gridView1.Columns)
        gridColumn.Summary.Clear();