programmatically making text box control read only - InfoPath Dev
in

InfoPath Dev

programmatically making text box control read only

Last post 09-17-2008 08:29 AM by Bhavesh. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-07-2008 04:26 AM

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    programmatically making text box control read only

    Hi,

    How to set text box control read only programmatically using c sharp.

  • 08-07-2008 05:54 AM In reply to

    Re: programmatically making text box control read only

    Hi,

    It is not possible for Infopath controls.

    Swathip
    www.ggktech.com
  • 08-07-2008 08:48 AM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: programmatically making text box control read only

    Hi,

    I am using Infopath 2007 OM.

    I am selecting control using xpathnavigator it gives CanEdit property,using this can i make it read only?

  • 08-11-2008 04:57 AM In reply to

    Re: programmatically making text box control read only

    Hi

    CanEdit property is a read only property you cannot set it. 

    Set it in design mode.

     

    Madhuri

     

  • 08-13-2008 04:07 AM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: programmatically making text box control read only

    then thier is no way to make text box read only programmatically?

  • 09-17-2008 08:29 AM In reply to

    • Bhavesh
    • Top 500 Contributor
      Male
    • Joined on 05-01-2008
    • Atlanta
    • Posts 40

    Re: programmatically making text box control read only

    Hi,

    There is a workaround solution for your requirement. You put one text box on the form. add one more node in the datasource but do not include it on the screen. (name it as my:MakeREADONLY) this will work as a flag for making the first control read only. Now add conditional formatting on first control that if the flag is true then make it read only/disable.

    Programatically you set the value of the flag field to TRUE as per your requirement.

    XPathNavigator ReadOnlyNav = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:MakeREADONLY", NamespaceManager);

    ReadOnlyNav.SetValue("1");

    Hope it will solve your problem.

    Bhavesh 

     

     

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