Define the value of a checkbox - InfoPath Dev
in

InfoPath Dev

Define the value of a checkbox

Last post 05-19-2005 12:07 PM by Agni Jonnalagadda. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-18-2005 01:00 AM

    Define the value of a checkbox

    Hi,

    I try to do some C# for check my checkbox in Infopath:

    Depend on a binary value (for example = 00000000001000000000000001000000)

    I want to make a substring of the 10th number for see if is value is 1. If it is I wan't to check my checkbox.

    With a text label I can make that in design I can assign a value depend of a substring.

    With the rules I can't because substring is not accessible!

    So I try with C# but my code don't work:

    [InfoPathEventHandler(MatchPath="/ns1:source/ns1:tabMuster/ns1:Muster/@ns1:Flags", EventType=InfoPathEventType.OnAfterChange)]
    public void Flags_attr_OnAfterChange(DataDOMEvent e)
    {
    IXMLDOMNode toto = thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/ns1:field4");
    IXMLDOMNode Flags = thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/@ns1:Flags");

    if( Flags.text.Substring(10)=="1")
    {
    toto.text="1";
    //thisXDocument.DOM.replaceChild(Flag,thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/ns1:field4"));
    }


    What I'm doing wrong? Any idea about how to to that(in design or with C#)?

    Thanks a lot for your help it's very appreciated!

    Thierry

    P.S. Sorry for my English


    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
  • 05-19-2005 12:07 PM In reply to

    Re: Define the value of a checkbox

    This can be done through InfoPath itself. You can have rule on "field4", In the you need to specify a condition and check what is the 10th character in the string, you can use InfoPath substring functions for this.


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