Hi
 
As additional info, below is the recorded vbScript code as I cannot see the attached file that went with the original post
 
Sub TestAddingChildRow
  Dim grid
  Dim grid2
  Dim xamDataGridEx
  Dim recordListControl
  Dim xamTextEditor
  Dim button
  ' display the xamDataGrid
  Set grid = Aliases.RHICOMS_SAM.HwndSource_ShellWindow.ShellWindow.LayoutRoot
  Call grid.Grid2.ApplicationRibbon.ClickItem("Configuration|Component Classes")
  Call Delay(1901)
  Set grid2 = grid.Grid.XamDockManager.DocumentContentHost.TabbedDocumentSplitPane.SplitPane.ztabGroupMainRegion.ContentpaneComponentsClasses.ModuleComponentsDimensionsView.Grid
  Set xamDataGridEx = grid2.XamDockManager.SplitPane.ComponentClassesContentPane.ComponentClassesGrid
  Set recordListControl = xamDataGridEx.Grid.RecordListControl
  Call recordListControl.Drag(1128, 24, -5, 205)
  Call Delay(1433)
  ' go to last row on the grid and add the new parent row
  Call xamDataGridEx.ClickNewRowCell("Component Class")
  Call Delay(1146)
  Set xamTextEditor = recordListControl.DataRecordPresenter.DockPanel.DataRecordCellArea.ContentItemGrid.CellValuePresenter.XamTextEditor
  ' type in value to the parent row which becomes row 216
  Call xamTextEditor.Keys("zzzzzz my new row")
  Call Delay(1647)
  ' save the grid changes
  Set button = grid2.Header.btnSave
  button.ClickButton
  Call Delay(1188)
  Call xamDataGridEx.ClickCellR(216, "Component Class")
  Call Delay(933)
  ' right click popup menus adds a child row
  Call xamDataGridEx.PopupMenu.Click("Add New SubComponent")
  Call Delay(1422)
  xamDataGridEx.Expand(216)
  Call Delay(1423)
  ' now we click in the cell on the new child row
  Call xamDataGridEx.wChildView(216).wChildView(0).ClickCell(0, "Sub Class")
  Call Delay(3423)
  Dim xamTextEditor2
  Call Delay(3423)
  'xamTexteditor2 should be on child row cell, but Object Spy browser values are as follows
  ' with the result that the "my new subrow" updates the incorrect row
  ' or we get an error thatt the object "XamTextEditor" does not exist.
  Set xamTextEditor2 =Aliases.RHICOMS_SAM.HwndSource_ShellWindow.ShellWindow.LayoutRoot.Grid.XamDockManager.DocumentContentHost.TabbedDocumentSplitPane.SplitPane.ztabGroupMainRegion.ContentpaneComponentsClasses.ModuleComponentsDimensionsView.Grid.XamDockManager.SplitPane.ComponentClassesContentPane.ComponentClassesGrid.Grid.RecordListControl.WPFObject("DataRecordPresenter", "", 5).WPFObject("DockPanel", "", 1).WPFObject("DataRecordCellArea", "", 1).WPFObject("ContentItemGrid").WPFObject("CellValuePresenter", "", 1).WPFObject("XamTextEditor", "", 1)
  Call Delay(992)
  Call xamTextEditor2.Keys("my new subrow")
  Call Delay(5150)
  button.ClickButton
End Sub