Add repeating table rows programatically using vb.net - InfoPath Dev
in

InfoPath Dev

Add repeating table rows programatically using vb.net

Last post 02-03-2010 05:25 PM by Aditya. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-01-2010 09:53 PM

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-26-2010
    • Sydney
    • Posts 59

    Add repeating table rows programatically using vb.net

    Hi,

     Could any body help me how can i add repeating tables using vb.net code on a dropdownlist changed event.

    Aditya,
    .Net programmer.
  • 02-01-2010 11:25 PM In reply to

    Re: Add repeating table rows programatically using vb.net

    this is c# code, i hope you will be able to convert it into vb 

    XPathNodeIterator listItemNav = this.MainDataSource.CreateNavigator().Select("xpath of your repeating table" this.NamespaceManager);

    for (int i = 0; i < listItemNav.Count; i++, listItemNav.MoveNext()) ;

    listItemNav.Current.Clone().InsertAfter(listItemNav.Current);

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 02-02-2010 04:17 PM In reply to

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-26-2010
    • Sydney
    • Posts 59

    Re: Add repeating table rows programatically using vb.net

    Hi Qazi,

     Thanks for your reply.I need bit more help fom u.I would like to connect to my Datasource(which is a webmethod) to retrive data and then i want to populate all the rows of repeating table with that data.I think i couldn't do this auto population of repeating table through Form settings.So i thought of writing some code in Button onclick or dropdown changed event.

    Ex:If i get 4 rows from dataset,i would like to populate repeating table 4 times.if 2 rows returned from datatable .I would like to repeat repeating table 2 time.I hope u will understand my task.

    Aditya,
    .Net programmer.
  • 02-02-2010 09:26 PM In reply to

    Re: Add repeating table rows programatically using vb.net

    use

    this.DataSources["your_Secondar_datasource"].CreateNavigator();

    to get handle to your data of secondary data connection, loop over it and populate your repeating table.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 02-03-2010 04:05 PM In reply to

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-26-2010
    • Sydney
    • Posts 59

    Re: Add repeating table rows programatically using vb.net

    Thanks,I did it.But if datasorce has got some NULL values,the xml created by createnavigator is just skipping that field.

    Ex:lets say, i am Retriving A,B,C values from datasource.If B is Null then,createnavigator is returning only A and C values only.It is not even showing B as empty attribute.

    My code is still searching for B field.If it is dataset,i could try IsDBnull.How to handle in this case for NULL values.

    Thanks,

    Aditya.

    Aditya,
    .Net programmer.
  • 02-03-2010 04:39 PM In reply to

    Re: Add repeating table rows programatically using vb.net

    To perform an action only when an object is not null, you can use:

    If Not object Is Nothing
          ' do your thing
    End If

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-03-2010 05:25 PM In reply to

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-26-2010
    • Sydney
    • Posts 59

    Re: Add repeating table rows programatically using vb.net

    Thanks that solved my problem.

    Aditya,
    .Net programmer.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.