in

InfoPath Dev

Dropdown within Reapeting table only updainting the first row

Last post 07-06-2007 10:07 AM by okiBill. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-06-2007 07:05 AM

    Dropdown within Reapeting table only updainting the first row

    I'm hoping someone can help solve this simple sounding problem.   I trying to load columns of a Repeating Table (RT) based on  data retrieved  from a SQL Server DB.    For the most part this works fine.  Numerous textboxes are loaded into multiple rows in the RT.  The problem is that the first column in the RT is a dropdown box.  Only the dropdown in the first row in the RT is being populated.  The dropdowns in the subsequent rows are blank.  With each iteration of the of my loop (code is below) the value that should be placed into the dropdown on the next row is overlaying the value in the first row.  Any help would be appreciated.

            Dim Nav As XPathNavigator = MainDataSource.CreateNavigator()
            Dim parent As XPathNavigator = MainDataSource.CreateNavigator.SelectSingleNode("/dfs:myFields/dfs:dataFields", NamespaceManager)
            Dim row As XPathNavigator = MainDataSource.CreateNavigator.SelectSingleNode("/dfs:myFields/dfs:dataFields/d:TimeAndAttendaceView", NamespaceManager)
            Dim i As Int16
            Dim rowCount As Int16 = ds.Tables("Hours").Rows.Count

            For i = 0 To rowCount - 1
                MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:TandAView/@DropDown",  _      
                    NamespaceManager).SetValue(ds.Tables("Hours").Rows(i).Item("DropDownText"))
                MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:TandAView/@TextBox1",  _        
                    NamespaceManager).SetValue(ds.Tables("Hours").Rows(i).Item("Textbox1Value"))

                MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:TandAView/@TextBox2",  _        
                    NamespaceManager).SetValue(ds.Tables("Hours").Rows(i).Item("Textbox2Value"))


                row.Clone()
                If i < ds.Tables("Hours").Rows.Count - 1 Then
                        parent.AppendChild(row)
                End If
            Next  i 

     

     

  • 07-06-2007 10:07 AM In reply to

    Re: Dropdown within Reapeting table only updainting the first row

    <>Just in case anyone is searching and looking for an answer - I eventually figured it out.  I added a subscript to the group name and worked.
     

            For i = 0 To rowCount - 1
                MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:TandAView[" & i + 1 & "]/@DropDown",  _      
                    NamespaceManager).SetValue(ds.Tables("Hours").Rows(i).Item("DropDownText"))

               .

               .

               .

     

Page 1 of 1 (2 items)
Copyright © 2003-2007 Qdabra Software. All rights reserved.
View our Terms of Use.