Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Hi I have Datagird where user can group it using group by area location. After grouping the grid, I am not able to fetch the data Item of the child records.Kindly help me to get the Data Item of the grouped records. I getting the count of child records as below code.For Each objDataRecord As GroupByRecord In dgrDataGrid.Records If DirectCast(objDataRecord.ChildRecords,RecordCollection).Count > 0 Then Dim i As Integer Dim intChildRecordCount=DirectCast(objDataRecord.ChildRecords, RecordCollection).Count For i = 0 To intChildRecordCount - 1 // By iterating the child record, how i can fetch the child record data Item Next i End IfNext Thanks in Advance
The Record class is the base class for all records (i.e. GroupByRecord, ExpandableFieldRecord, SummaryRecord, FilterRecord, DataRecord). You would just check if the object is a DataRecord and if so cast to that type. The DataRecord class exposes a DataItem property. So if you're using VB that might be something like
If TypeOf record Is DataRecord Then Dim dataRecord As DataRecord = DirectCast(record, DataRecord) Dim dataItem = dataRecord.DataItem
Hi,
Could you try the following code:
For Each record As GroupByRecord In DataGrid.Records If DirectCast(record.ChildRecords, RecordCollection).Count > 0 Then For Each child As DataRecord In record.ChildRecords Dim foo = child.DataItem Next End If Next
HTH,
I too need a solution for the above query.Please provide solution for the above query its urgent.
Thanks In Advance
Revathi