Optional Sections - InfoPath Dev
in

InfoPath Dev

Optional Sections

Last post 10-18-2005 07:43 PM by DavidCrabbe. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-18-2005 12:07 AM

    Optional Sections

    Optional sections within InfoPath have a context menu on the top left hand corner of the section which contains Copy, Cut and Paste - it's also displayed when the user right-clicks on a section.

    Unfortunately these controls allow users to alter the layout and data source of the form, which is undesirable (I have controls to achive this and don't want the user by-passing them). In addition, pressing the backspace key when the optional section is highlighted will delete the entire section from both form and xml data source.

    If there some manner in which I can disable the user's ability to add/remove, copy/cut/paste optiona sections and yet retain the ability to add the section through managed code?

    Thanks,
    David.
  • 10-18-2005 12:21 AM In reply to

    Hi David,
    Yes, you can either change the data source to add a minOccurs=1 to the items you don't want deleted. In addition, you can write an OnBeforeChange handler that filters the add/remove events and returns true or false for those. I forget the value, but it should be documented in the SDK (or you can just try one and see. Good luck!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-18-2005 12:33 AM In reply to

    You did beat me on that one Patrick...

    e.ReturnMessage = "Sorry can't add or delete entries!"; <-- Optional
    e.ReturnStatus = false;

    Franck Dauché
  • 10-18-2005 07:43 PM In reply to

    Thanks guys, I really appreciate the response.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.