> Hi, i tried to get the use the nametoColIndex function in a hierarchycal grid.
> It only worked with the parent-row.
>
> I want to "mask" some cells by hand with the event PrepareViewStyleInfo. How can i do that in a hierarchical grid (only in the child-row !) ???
>
> Kind regards,
>
> Stefan
You have to get the GridBoundRecordState object for the given row. This object has much information on the row such as its hierarchy level, its child list, its position in its parent, etc...
Here is a code snippet:
Dim rs As GridBoundRecordState = Me.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex)
Dim gbc As GridBoundColumn = Me.gridDataBoundGrid1.Binder.GetHierarchyLevel(rs.LevelIndex).InternalColumns("ColName")
If Not gbc is Nothing Then
Dim field As Integer = Me.gridDataBoundGrid1.Binder.GetHierarchyLevel(rs.LevelIndex).InternalColumns.IndexOf(gbc)
If Me.gridDataBoundGrid1.Binder.FieldToColIndex(field) = e.ColIndex Then
'found the column...
End If
End If