Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Custom Text in Group Row
posted

I am using a WebHierarchicalDataGrid to group data.  I have the columns and bands configured and they are displaying the data as they should.   

I would like to customize the text in the group row copied and pasted the following code to thee GroupedRowInitialized event.as follows:


If e.GroupedRow.ColumnGroupedBy.Key = "StopNum" Then

If e.GroupedRow.Value = DBNull.Value Then
'' Get number of items from default text
'Dim numItems As String = e.GroupedRow.Text.Substring(e.GroupedRow.Text.Length - 3, 3)
'e.GroupedRow.Text = "Reports to no one " & numItems
Else
Dim numItems As String = e.GroupedRow.Text.Substring(e.GroupedRow.Text.Length - 3, 3)
' Get value being grouped by
Dim value As Integer = CInt(e.GroupedRow.Value)
' Get the row with EmployeeID equal to the value being grouped by from the ReportsTo column.
' This returns the row for the employee that the rows that are being grouped reports to.
Dim record As GridRecord = Me.WebHierarchicalDataGrid1.Rows.FromKey(New Object() {value})
If record IsNot Nothing Then
' Get the name of the person to report to
Dim name As String = (record.Items(2).Value.ToString() & " ") + record.Items(2).Value.ToString()
e.GroupedRow.Text = ("Reports to " & name & " ") + numItems
End If
End If
End If

All of the records in the bands are grouped by 'StopNum'

The problem at this point that i am having is it does not appear that the GroupedRowInitialized is firing.     I am new to infragistics and and hoping that i can get some help with first figuring out why this is not firing and then configuring the custom text that i would like to appear.   If i can get the grid to work the way i want i am going to upgrade to the most recent version of the ultimate subscription.

any helper would be greatly appreciated.

Parents Reply Children
No Data