<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx</link><description>LightSwitch provides built-in functionality quickly add or edit data in a grid or list.&amp;#160; Unfortunately this modal dialog is not customizable.&amp;#160; In more complex data entry scenarios, the built-in dialogs may not fulfill your customer's needs.&amp;#160;</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10400302</link><pubDate>Thu, 07 Mar 2013 15:06:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10400302</guid><dc:creator>LThibx</dc:creator><description>&lt;p&gt;Sheel, &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your &amp;nbsp;DialogHelper is a great solution for modal window implementation. I have used it in a couple projects. &amp;nbsp;Have you experienced any issue in VS 2012? I had a project that worked correctly in VS 2010, but after migrating to VS 2012, When I load a screen with the DialogHelper implementation &amp;nbsp;I receive the following error: &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;An error occurred while running the screen.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Error details: Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt;Debugging, it happens right after exiting from the screens IntializeDataWorkspace Sub, &amp;nbsp;My code is: &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Private MWPersonExpenseDialogHelper As DialogHelper&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Private MWPersonMileageDialogHelper As DialogHelper&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;InitializeDataWorkspace -sets up Modal Windows for both PersonExpensesFiltered and Person_Mileage&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Private Sub ListPersons_PersonExpenses_InitializeDataWorkspace(saveChangesTo As List(Of Microsoft.LightSwitch.IDataService))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;Setup dialogs for both modal windows&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MWPersonExpenseDialogHelper = New DialogHelper(Me.PersonExpensesFiltered, &amp;quot;MWPersonExpense&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MWPersonMileageDialogHelper = New DialogHelper(Me.Person_Mileage, &amp;quot;MWPersonMileage&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;Initialize PEPagingValue &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;Me.PEPagingValue = Me.Details.Properties.PersonExpensesFiltered.PageSize&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Sub&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;Private Sub ListPersons_PersonExpenses_Created()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39; &amp;nbsp; &amp;nbsp;&amp;#39;Initialize Modal Windows&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MWPersonExpenseDialogHelper.InitializeUI()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MWPersonMileageDialogHelper.InitializeUI()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;End Sub&lt;/p&gt;
&lt;p&gt;I am trying to utilize two modal windows on this screen, but i have tried reducing it to one, same error. &lt;/p&gt;
&lt;p&gt;I can&amp;#39;t seem to determine what Object LS is complaining about. Either or both of the MWPerson... objects are instantiated after the return, but as soon as I step out of the End Sub from InitializeDataWorkspace. I get the error mentioned above. &lt;/p&gt;
&lt;p&gt;Hoping you can shed some light on the issue. &lt;/p&gt;
&lt;p&gt;Thanks in advance. &lt;/p&gt;
&lt;p&gt;LThibx&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10400302" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10381419</link><pubDate>Mon, 31 Dec 2012 03:12:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10381419</guid><dc:creator>VictorPerez</dc:creator><description>&lt;p&gt;Really very useful, thank you.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10381419" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10374508</link><pubDate>Tue, 04 Dec 2012 16:25:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10374508</guid><dc:creator>OOps</dc:creator><description>&lt;p&gt;Dear Sheel,&lt;/p&gt;
&lt;p&gt;thanks for the solution. I am very new to Lightswitch and I have a question to your solution:&lt;/p&gt;
&lt;p&gt;You have a Private Sub EditableCustomersGridOld_InitializeDataWorkspace, why &amp;quot;Old&amp;quot; and what is it for, and where or when will the customersDialogHelper ever be created? &lt;/p&gt;
&lt;p&gt;many regards&lt;/p&gt;
&lt;p&gt;OOps&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10374508" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10353336</link><pubDate>Wed, 26 Sep 2012 09:18:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10353336</guid><dc:creator>Abuggie</dc:creator><description>&lt;p&gt;Here&amp;#39;s a link to a page where someone translated into c#, and not only partially like yann...&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://tejana.wordpress.com/2011/07/11/creating-a-custom-add-or-edit-dialog-in-lightswitch-c-beta2/"&gt;tejana.wordpress.com/.../creating-a-custom-add-or-edit-dialog-in-lightswitch-c-beta2&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10353336" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10250288</link><pubDate>Thu, 22 Dec 2011 11:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10250288</guid><dc:creator>Belu</dc:creator><description>&lt;p&gt;Anyone knows how to provide specific screens for adding/editing records? Because the built-in modal dialog don´t let me add new child records at the same time I’m adding the main record. I created a screen that let me do that but I don´t know how to pass the parent Id to the child so I don´t have to complete it manually&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10250288" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10242217</link><pubDate>Tue, 29 Nov 2011 01:01:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10242217</guid><dc:creator>Ng</dc:creator><description>&lt;p&gt;Anyone found the work around for Ray and Markus&amp;#39;s problem mentioned above? &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10242217" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10231388</link><pubDate>Sun, 30 Oct 2011 05:18:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10231388</guid><dc:creator>Ray Cacciatore</dc:creator><description>&lt;p&gt;I&amp;#39;m having a problem when I click the OK button on the modal dialog. If I enter no info in the dialog and I press OK, none of the validation errors appear, it just closes and the record in the datagrid stays in the datagrid with the empty fields. I&amp;#39;d like the dialog to stay opened and show the validation errors, even when the user clicks ok.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10231388" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10215699</link><pubDate>Fri, 23 Sep 2011 06:42:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10215699</guid><dc:creator>Markus G</dc:creator><description>&lt;p&gt;Thank you for this great example.&lt;/p&gt;
&lt;p&gt;Is there a way to disable the Enter key because the Enter key triggers the close event by default !!! &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10215699" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10208869</link><pubDate>Sat, 10 Sep 2011 06:06:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10208869</guid><dc:creator>bhuven</dc:creator><description>&lt;p&gt;Will also appreciate code in C# please&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10208869" width="1" height="1"&gt;</description></item><item><title>re: Creating a Custom Add or Edit Dialog (Sheel Shah)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx#10196713</link><pubDate>Wed, 17 Aug 2011 14:02:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10196713</guid><dc:creator>Misi Moisei</dc:creator><description>&lt;p&gt;Would appreciate if the code would be in C#&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10196713" width="1" height="1"&gt;</description></item></channel></rss>