<?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>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Switching to ReadOnly view based on input parameters</title><link>https://www.infopathdev.com:443/forums/thread/92646.aspx</link><pubDate>Sun, 01 Sep 2013 22:26:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:92646</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/92646.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=92646</wfw:commentRss><description>&lt;p&gt;Have your code behind set a field in your main data source (or a secondary one, for example, you could add an XML file with &amp;quot;state&amp;quot; fields as a resource). Then, add a rule to that field which has an action to switch the view. :)&lt;/p&gt;</description></item><item><title>Switching to ReadOnly view based on input parameters</title><link>https://www.infopathdev.com:443/forums/thread/92547.aspx</link><pubDate>Tue, 27 Aug 2013 14:45:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:92547</guid><dc:creator>coomanperson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/92547.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=92547</wfw:commentRss><description>Hey all.

Basically i have a form that does a &amp;quot;GET&amp;quot; if there is an input parameter (ID), otherwise it sets up for a post.  The &amp;quot;GET&amp;quot; action is checked on the Form_Loading event in the code behind.  If we do indeed get an ID, I would like to switch to my readonly view where the user must then click a button in order to edit.  

How would I go about this.  I cannot do a this.viewInfo.SwitchView(&amp;quot;x&amp;quot;); on form load, because it causes an error stating the view is not ready, which makes sense.  And unfortunately the formLoad rules run before the code behind. 

Any ideas are welcome, thanks in advance.</description></item></channel></rss>