Change the group name in a grouped grid

Using the Telerik ASP.NET grid, when you group the default text that shows up in the grid group header is 

FIELDNAME: FIELDDATA

If you include 

HeaderText = "myGroupHeaderText"

You'll get

myGroupHeaderText: FIELDDATA

What if you only want

FIELDDATA?

 

Here's the trick:

Private Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If TypeOf e.Item Is GridGroupHeaderItem Then
        Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)
        Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
 
 
        item.DataCell.Text = groupDataRow("mycolumnname").ToString
    End If
End Sub

 

 

 


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