Position of current node - InfoPath Dev
in

InfoPath Dev

Position of current node

Last post 11-09-2005 02:15 PM by Agni Jonnalagadda. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-07-2005 07:31 AM

    Position of current node

    Hi,

    I use c# for coding!

    I have a master/detail table and I need to know which row it is when I click on the button! the button is in detail table

    How I can make this? Agni has give me some idea in a previous post he has write:
    quote:

    Hi,
    If the button is in the row, "e.Source" will get you the selected row.

    If the button is at the bottom you can use

    //xPath should poin to the Repeating node
    IXMLDOMNode oNodes = getNode("/RootNode/RepeatingNode");]

    //"CTRL22":- you will get this when you see the view.xsl file for that particular repeating table
    int iMemberId = Convert.ToInt32(thisXDocument.GetNamedNodeProperty(oNodes, "CTRL22", "-1"));

    This above line will get you the selected the rowID. With that row id you can get the node.

    Agni
    InfoPathDev India


    I don't think I can use e.source this time but for the other method that makes me an error on getNode that say :

    getNodes doesn't exist in the class or in the namespace ...

    Thanks for your help!

    ++

    Thierry



    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-07-2005 09:59 AM In reply to

    Re: Position of current node

    Hi Thierry,

    I am confused here. Isn't "getNode" a function somewhere that has code in it around: e.Source.select...?

    Franck
  • 11-07-2005 11:40 PM In reply to

    Re: Position of current node

    Hi Franck,

    Merci pour la réponse!

    I was mistaken (je me suis trompé) I can use e.source for select my correct node and make my replacechild with it!

    But I don't know how to know my position? Is for another field that I need to find it!

    with e.source that don't seems to work that send me always :"-1"

    Any idea?

    Thanks



    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-08-2005 10:22 PM In reply to

    Re: Position of current node

    Nope, sorry. Maybe Agni could jump back on this one...
  • 11-09-2005 05:35 AM In reply to

    Re: Position of current node

    ok no problem thanks a lot!

    I have found another way that work great now!

    But if Agni can explain me his solution I will be very happy!

    Agni if your hear me..

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-09-2005 02:15 PM In reply to

    Re: Position of current node

    Hi Thierry,
    Sorry for being late!
    Here is one of the ways you can get position of current row,

    //Get the list of nodes that are preceeding the present node
    IXMLDOMNodeList preceedingNodesList = thisNode.selectNodes("preceding-sibling::RepeatingNode");
    //Get the count of the preceeding nodes and add 1 to get the position of this node
    int position= preceedingNodesList.length + 1;

    Hope this helps!

    Agni
    InfoPath Dev India
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.