We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GroupSummaryRow in VB.NET examples

While trying your sfDataGrid, I was trying to programmatically group and create summeries for my sfDataGrid. The examples I found are all C# and XAML. I am using VB.NET and I find it hard to translate it. Can any one show me how to do this in VB.NET ??
Here's what I've found in C#:
this.dataGrid.GroupSummaryRows.Add(new GridSummaryRow()
    ShowSummaryInRow = false,    
    SummaryColumns = new ObservableCollection<ISummaryColumn>()
        new GridSummaryColumn()
            Name = "PriceAmount", 
            SummaryType= SummaryType.Int32Aggregate, 
            Format="Amount - {Sum:c}"
        new GridSummaryColumn()
            Format="Count - {Count:d}"

any help please??

1 Reply

JG Jai Ganesh S Syncfusion Team June 30, 2016 02:58 PM UTC

Hi mohd, 
You can achieve your requirement to programatically add the group summaries in VB.NET like below, 
Me.dataGrid.GroupSummaryRows.Add(New GridSummaryRow() With { 
     .ShowSummaryInRow = False, _ 
    .SummaryColumns = New ObservableCollection(Of ISummaryColumn)() From { 
        New GridSummaryColumn() With { 
             .Name = "Age", 
             .MappingName = "EmployeeAge", 
             .SummaryType = SummaryType.Int32Aggregate, 
             .Format = "Count - {Count:d}" 
        New GridSummaryColumn() With { 
            .Name = "Salary", 
            .MappingName = "EmployeeSalary", 
            .SummaryType = SummaryType.CountAggregate, 
            .Format = "Amount - {Sum:c}" 
Jai Ganesh S 

Live Chat Icon For mobile
Up arrow icon