Thanks Hilary
I looked at the code and tested it and it worked. However when i included the IF Statement which gave me no errors nothing seems to happen. I created 2 if statements to test out and both gave no results. Im wondering if im doing the syntax all wrong.
Public Sub CTRL752_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
' Write your code here.
' Retrieve a reference to the Main DOM
Dim root As XPathNavigator = MainDataSource.CreateNavigator()
'Ist attempt
'Dim GetValue As Object
'GetValue = "DELETE"
'If GetValue = ("//my:myFields/my:group3/my:group4/my:DELETEROW") Then
'2nd attempt
Dim fieldValue As String = MainDataSource.CreateNavigator().SelectSingleNode( _
"/my:myFields/my:group3/my:group4", NamespaceManager).Value
If fieldValue = "delete" Then
' Count the amount of group2 nodes
Dim iter As XPathNodeIterator = root.Select( _
"/my:myFields/my:group3/my:group4", _
NamespaceManager)
Dim group2NodesCount As Integer = iter.Count
' Retrieve the first group2 node
Dim firstGroup2NodeNav As XPathNavigator = _
root.SelectSingleNode("/my:myFields/my:group3/my:group4[1]", _
NamespaceManager)
' Retrieve the last group2 node
Dim lastGroup2NodeNav As XPathNavigator = _
root.SelectSingleNode("/my:myFields/my:group3/my:group4[" & _
group2NodesCount.ToString() & "]", _
NamespaceManager)
' Delete the range of nodes from the first to the last group2 nodes
firstGroup2NodeNav.DeleteRange(lastGroup2NodeNav)
End If
End Sub