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