The Uye The Uye - 1 year ago 271 Question

How to create group alpabet gridview devexpress?

Can any one help me to create group alphabet gridview to look like this picture?
I've tried with this code, but rows are not grouped by alphabet.

Private Sub GridView1_CustomColumnDisplayText(sender As Object, e As CustomColumnDisplayTextEventArgs) Handles GridView1.CustomColumnDisplayText
If e.Column.FieldName = "CompanyName" AndAlso e.IsForGroupRow Then
Dim rowValue As String = GridView1.GetGroupRowValue(e.GroupRowHandle, e.Column)
Dim val As String = Microsoft.VisualBasic.Left(rowValue, 1)
e.DisplayText = val
End If
End Sub

group alpabet gridview devexpress

Answer Source

There is no need to handle the CustomColumnDisplay text event handler to extract the first letter of the "CompanyName" value. Instead, simply set the GridColumn.GroupInterval property for the "CompanyName" GridColumn to "Alphabetical". For instance:

MyGridView.Columns("CompanyName").GroupInterval = ColumnGroupInterval.Alphabetical
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download