We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

nametoColindex in a hierarchycally grid model

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

2 Replies

AD Administrator Syncfusion Team August 6, 2003 01:29 AM

> 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


KN Karl-Heinrich Nagel August 6, 2003 05:17 AM

It works ! Thanks a lot for your support

Loader.
Live Chat Icon For mobile
Up arrow icon