May I have help with the following error?
{"Operation is not valid, because of the current state of the object."}
I have one multiple selection listbox which I wish to populate into one textbox field. I loop through the selected items which are nonempty and store into a string. I am getting the above error on the SetValue method. Thanks for your help.
Public Sub Model_ListBox_Changing(ByVal sender As Object, ByVal e As XmlChangingEventArgs)
' Ensure that the constraint you are enforcing is compatible
' with the default value you set for this XML node.
' Write your code hereDim root As XPathNavigator = MainDataSource.CreateNavigator()
Dim iter As XPathNodeIterator = root.Select( _"/my:myFields/my:group1/my:group2/my:group3/my:Model_ListBox", NamespaceManager)
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder()While (iter.MoveNext())
Dim value2 As String = iter.Current.Value
If value2 <> "" Then
sb.AppendFormat(value2)
sb.AppendFormat(";")
End If
End Whileroot.SelectSingleNode("//my:Model_ListBox_Collapsed", _
NamespaceManager).SetValue(sb.ToString())
End Sub