Winforms - Gridview - Grouping

Code examples for grouping functionality in WinForms GridView

Related Articles

... and you 'll find more on the Telerik Winforms Grid Menu

 

 

'======================================================================================================
'set grouping
'======================================================================================================
Dim groupdescriptor As New Telerik.WinControls.Data.GroupDescriptor()
groupdescriptor.GroupNames.Add("employeeName", System.ComponentModel.ListSortDirection.Ascending)
Me.RadGridView1.GroupDescriptors.Add(groupdescriptor)
 
Dim groupdescriptor2 As New Global.Telerik.WinControls.Data.GroupDescriptor()
groupdescriptor2.GroupNames.Add("BillingDate", System.ComponentModel.ListSortDirection.Ascending)
'The text of the group header row is a formatted string with the following parameters:
'{0} – Property name –the name of the RadGridView column by which the grouping is performed;
'{1} – Group value
'{2}, {3} … - Aggregates values
groupdescriptor2.Format = "{0}: {1:MM/dd/yyyy} "
Me.RadGridView1.GroupDescriptors.Add(groupdescriptor2)
 
'set the grid datasource
Me.RadGridView1.DataSource = getGridDataSource()
'expand the groups
For Each oDataGroup As DataGroup In Me.RadGridView1.Groups
    oDataGroup.Expand()
Next
'======================================================================================================

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences