How to set value in text box value? - InfoPath Dev
in

InfoPath Dev

How to set value in text box value?

Last post 05-14-2005 09:51 PM by liorlankri. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-11-2005 02:44 AM

    How to set value in text box value?

    I have a Text Box in my form type Decimal

    In my code (C#) I want to set value for it

    this.thisXDocument.DOM.selectSingleNode("//my:myFields/MyTextBox").text=44.77;

    I get an Error. How to do this?
  • 05-11-2005 10:09 AM In reply to

    Re: How to set value in text box value?

    Please keep in mind that in your code you are setting text values regardless of the datatype specified in the schema. The schema identifies how to interperet the text value. But in your code, when setting a value, you must specify a text value when you are using the .text property.

    If you want to not convert to a string, you might try using .nodeTypedValue instead. I believe (please verify yourself) that this will allow you to use an actual decimal value.

    Greg Collins [InfoPath MVP]
    InfoPathDev
  • 05-14-2005 09:51 PM In reply to

    Re: How to set value in text box value?

    My Text box is DataType Decimal.
    In my code I have this:

    this.thisXDocument.DOM.selectSingleNode("//my:myFields/my:MyTextBox").nodeTypedValue= 4.77

    I get this Error

    "System.Runtime.InteropServices.COMException"
    It's work only when the Text Box type is Text!

    Do I need do somthing with IXMLDOMNode?
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.