<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/51367.aspx</link><pubDate>Wed, 03 Feb 2010 18:53:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51367</guid><dc:creator>zxkuqyb</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51367.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51367</wfw:commentRss><description>&lt;p&gt;I use this...&lt;/p&gt;
&lt;p&gt;if (XDocument.IsReadOnly)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;The form cannot be modified.&amp;nbsp; Please try again later.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*****What I&amp;#39;d like to figure out is to throw a message to the user that shows the Current User Name of who has the &amp;#39;Original&amp;#39; Form opened in Edit Mode...that&amp;#39;s the mystery.&amp;nbsp; Anyone have an idea?&lt;/p&gt;</description></item><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/47660.aspx</link><pubDate>Wed, 07 Oct 2009 12:56:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47660</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47660.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47660</wfw:commentRss><description>Found it myself :)

this.ReadOnly - Attribute, tell me if the Form was opened in Read Only State.

Also its possible to change the View whithin the FormsEvent_Loading - Event with:

e.SetDefaultView(&amp;quot;NAME&amp;quot;);</description></item><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/47650.aspx</link><pubDate>Wed, 07 Oct 2009 08:00:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47650</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47650.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47650</wfw:commentRss><description>Okay ;) but i still need to know if the Form was opened in Read Only State to switch to the Read Only view to dont let the User make changes at the form :)</description></item><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/47643.aspx</link><pubDate>Wed, 07 Oct 2009 02:43:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47643</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47643.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47643</wfw:commentRss><description>&lt;p&gt;user cannot edit a read only view so you dont need to be concerned about that&lt;/p&gt;</description></item><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/47619.aspx</link><pubDate>Tue, 06 Oct 2009 11:03:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47619</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47619.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47619</wfw:commentRss><description>Sorry my VERY late answer ^^


Indeed this would be a option, to switch to a ReadOnly view to prevent that a user could change something in the Form and gets the Save Promt. But doesnt this mean something has changed in the Formular already?


My first Problem is; where can i get the information in my Code Behind / or even directly in the Form, that the Form is currently opened in &amp;quot;Read Only&amp;quot; mode ?


My second Problem: Those Save / Save As Buttons are already deactivated (under Tools / Form Optionts / Open and Save) as you mentioned, but if the User changes a &amp;quot;Read Only&amp;quot; Formular it sill askes him, while he close the Form, if he want save those changes. If he say yes a new Formular will be created in my Document Library as copy of the &amp;quot;Read Only&amp;quot; Formular, but with those made changes.


Thats something which must be also prevented! And therefore i see only the chance to switch to a Read Only View, if the Form was opened in Read Only Mode.</description></item><item><title>Re: ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/45965.aspx</link><pubDate>Tue, 18 Aug 2009 15:14:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45965</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45965.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45965</wfw:commentRss><description>&lt;p&gt;Hi --&lt;/p&gt;
&lt;p&gt;To prevent the &amp;#39;save&amp;#39; prompt when the user clicks the red x, simply set the form template to not allow Save or Save As -- you&amp;#39;ll find this option under &lt;strong&gt;Tools / Form Options / Open and Save&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;As to the read only -- I think you&amp;#39;ll need to create a view that is set to Read Only and switch to that in open rules (or in the form&amp;#39;s loading event, if you prefer code) based on user roles. Ummmm.... as far as your statement &amp;quot;you can add a Additional View in your InfoPath Form. Usually used as Print View&amp;quot;, just so you know, there are a lot of reasons to add different views to your form, printing would be just one option. &lt;/p&gt;</description></item><item><title>ReadOnly Questions</title><link>https://www.infopathdev.com:443/forums/thread/45960.aspx</link><pubDate>Tue, 18 Aug 2009 09:37:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45960</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45960</wfw:commentRss><description>&lt;p&gt;Hi Guys :D &lt;/p&gt;
&lt;p&gt;just a bunch of question which i am sure this will be no deal for you to answer. All Questions referring to Code Behind in C#.&lt;/p&gt;
&lt;p&gt;1.) How to indicate if the current opened Form is in &amp;quot;Read Only&amp;quot; mode? For example if the user hasnt the permission to save the form with any kind of edits. &lt;/p&gt;
&lt;p&gt;2.) As all of you should know, you can add a Additional View in your InfoPath Form. Usually used as Print View. And you can configure this View to be &amp;quot;Read Only&amp;quot;, so if someone Switch to this View (which can also be deactivated) he cant edit anything. Is it possible to set this kind of &amp;quot;Feature&amp;quot; to any View with Code? My Idea is to change all Views to &amp;quot;Read Only&amp;quot; if the File itself is in &amp;quot;Read Only&amp;quot; Mode - so the user cant change anything and dont wonder why he cant save it. &lt;/p&gt;
&lt;p&gt;3.) If 2.) isnt possible, how to prevent the following Situation - A User open the Form which File is in Read Only Mode. (due insufficiant permissions). &lt;/p&gt;
&lt;p&gt;- The User is changing a Textfield &lt;br /&gt;- He cant Save the File, so he press the X - to close the Window. &lt;br /&gt;- THEN InfoPath ask&amp;#39;s him if he want to save the File, if he Press YES it will be saved ... as new File with a new Filename (as generated in the submit Rule). I must prevent this!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But how to prevent it? I read something about a OnSaveEvent or something like This as EventHandle, but how to Add this EventHandle to my Code? Thanks a lot for your tipps :) Im also happy if someone throw me a brik on my head - with some links to other Topics or/and other pages.&lt;/p&gt;</description></item></channel></rss>