SilverlightShow: Creating Rich Data Forms in Silverlight - Introduction Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) Re: Creating Rich Data Forms in Silverlight - Introduction <p>Hello,</p> <p>I do maintenance in a Silvelight 4 web application that use dataform.<br /> I mainly use dataform AutoGenerateFields="True" and its works well. <br /> But with comboBox I need to define wether I want a default value or not. The combobox seem to be " mandatory", cause when I select the empty value et validate the form  the validation/exception msg "Input is not in the correct format is diplayed" in red.</p> <p>Is there a way to allow null value and avoid "Input is not in the correct format" message?</p> <p>Thanks in advance</p> <p>JEROME</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment8715 jeriani http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 14 Dec 2012 18:59:46 GMT Re: Creating Rich Data Forms in Silverlight - Introduction <p>Hello,</p> <p>I do maintenance in a Silvelight 4 web application that use dataform.<br /> I mainly use dataform AutoGenerateFields="True" and its works well. <br /> But with comboBox I need to define wether I want a default value or not. The combobox seem to be " mandatory", cause when I select the empty value et validate the form  the validation/exception msg "Input is not in the correct format is diplayed" in red.</p> <p>Is there a way to allow null value and avoid "Input is not in the correct format" message?</p> <p>Thanks in advance</p> <p>JEROME</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment8714 jeriani http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 14 Dec 2012 17:14:05 GMT Re: Creating Rich Data Forms in Silverlight - Introduction <p>Good job, I read another article and created a Data Form from it, but this one allowed me to understand how it actually works,,, Thanks!</p> <p>If there a way to place the field label in top for an individual field?</p> <p>Can the DescriptionViewer be on at all times?</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment6253 RicardoMiquilarenaUrrutia http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 02 Jun 2011 23:34:27 GMT form.show() in Silverlight private void LoanCalculationButton_Click(object sender, RoutedEventArgs e) { LoanCalculation loanCalculation = new LoanCalculation(); loanCalculation.Show(); } http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment5542 Nidhi Shah http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Sat, 19 Feb 2011 11:36:43 GMT RE: Creating Rich Data Forms in Silverlight - Introduction <em><span style="font-size: 11pt; line-height: 115%; font-family: calibri, sans-serif;">The article has been updated to the latest version of Silverlight and Visual Studio.</span></em> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment5440 lnikolov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Sun, 06 Feb 2011 17:22:36 GMT fails to validate and save <p>Big SNAG!!</p> <p>if you say dataform.CurrentItem = obj; and obj is of type private class, the form acts weird! It shows the fields but doesn't save or show validation errors!</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment4640 Gideon http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Sun, 10 Oct 2010 00:32:20 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <span class="medium_text" id="result_box"><span title="Bom artigo!" style="background-color: #ffffff;">Good article! </span><span title="Tenho um problema que você pode me ajudar." style="background-color: #ffffff;">I have a problem you can help me. </span><span title="Como faço para customizar os butões do dataForm?" style="background-color: #ffffff;">How do I customize the buttons DataForm? </span><span title="Tenho que trocar os icones do dataForm por icones personalizados." style="background-color: #ffffff;">I have to change the icons of DataForm for custom icons.</span></span> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment3382 Josemar http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 13 Apr 2010 15:40:25 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Very grateful for the tutorial<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2776 jose flores http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 15 Dec 2009 19:16:40 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Good article. http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2746 Murali http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 08 Dec 2009 16:34:27 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction When I try to use the <span style="color: rgb(83, 83, 83); font-family: arial, verdana, tahoma, sans-serif; font-size: 14px; line-height: 20px; ">System.Windows.Controls.Data.DataFormToolkit.dll rather than the System.Windows.Controls.Data.DataForm.dll I no longer have access to the .Fields property of the DataForm, which is used for customization of the DataForm.  Any ideas?</span> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2733 gep13 http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 01 Dec 2009 15:42:49 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction try System.Windows.Controls.Data.DataFormToolkit.dll http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2707 xxx http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Mon, 23 Nov 2009 15:41:36 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction I cannot find System.Windows.Controls.Data.DataForm.dll anywhere. I have downloaded SL 3 as well as toolkit and ran a search on my c drive and it found no file with that name. http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2665 Aleksey K http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 12 Nov 2009 20:04:12 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <p>Why don't I see Windows.system.Controls.Data.DataForm Dll when I try to add a reference to it?  All of the other .Data Dlls are there.  They are all under C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Libraries\Client.</p> <p> </p> <p> </p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2581 Dan http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 27 Oct 2009 22:06:25 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <p>Why don't I see Windows.system.Controls.Data.DataForm Dll when I try to add a reference to it?  All of the other .Data Dlls are there.  They are all under C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Libraries\Client.</p> <p> </p> <p> </p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2580 Dan http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 27 Oct 2009 22:05:20 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <p>Nice introduction, thumbs up!</p> <p>Worth mentioning, this code needs some adjustements in order to make it work with the latest release of the Silverlight Tookit. Some attributes names have changed - see here: <a shape="rect" href="http://silverlight.net/forums/p/109581/258546.aspx" shape="rect">http://silverlight.net/forums/p/109581/258546.aspx</a>. Also, a nice enhancement of the new out-of-the-box DataForm is that it now automatically places a combobox to edit the values taken from an Enum (Genere), instead of a textbox, like it was the case with the old version.</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2236 Bogdan http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 13 Aug 2009 11:17:22 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Thanks for the post, very useful. <p>Now I am trying to include lookup capabilities for reference data in my model. So with your example of the movie you also have a genre, in this example it's probably an enum, but potentially it is another domain entity with its own form to manage the genres. Does the dataform control include the ability to have this reference data included as either a dropdown list or as a lookup control in order to select a value from the reference entity? I understand that I could customize the template to include this, but it would be time saving if this were built into the control. ASP Dynamic Data has this feature.</p> <p>Any comment will be useful</p> <br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2207 Marcw http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Wed, 05 Aug 2009 12:37:48 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction This helped me a lot<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2204 Nishad http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 04 Aug 2009 09:58:44 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction @Abhinay: You can see this topic <a shape="rect" href="http://silverlight.net/forums/t/115097.aspx" shape="rect">http://silverlight.net/forums/t/115097.aspx</a> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2200 boyanmihailov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Mon, 03 Aug 2009 20:24:25 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Hi, <p>Can we add dynamically user control instead of statically defining it in to Data Template in XAML code.</p> <p>Thanks,</p> Abhinay Agrawal.<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2197 Abhinay http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Mon, 03 Aug 2009 13:04:50 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction I've found out that if you don't have a default constructor for the class record bounded to the dataform ItemSource the "+" icon add button will never be enabled.  <br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2190 Mark http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Sat, 01 Aug 2009 00:20:05 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction I can't seem to get the add item "+" button to be enabled.  The "+" icon is visible but it's always grayed out.<span id="ctl00_ctl00_MasterContent_Content_wikiSourceLabel"></span>  My ItemsSource is set to an ObservableCollection and the delete icon "-" isn't gray and works.  I'm not using the Beta.  Anyone else having this problem?<br /> <p> </p> <p></p> <br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2173 Mark http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 28 Jul 2009 08:46:54 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction @Mark: Sure! You can use whatever control in a field http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2119 boyanmihailov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 24 Jul 2009 20:56:25 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction What about a passwordBox?  Can you do this with DataForms??<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment2105 Mark http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 24 Jul 2009 03:16:10 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction @<span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl20_lblCommentAuthor">Satish: Look at the part Customizing DataForm Fields. You can use <span style="font-size: 13px"><strong>DataFormTemplateField</strong> <span style="color: #ff0000"></span></span>field to create your own display & edit fields. For each custom field you define a DataTemplate so you can place your custom controls in it.</span> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1984 boyanmihailov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 16 Jul 2009 19:30:42 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <p>@boyanmihailov: Sorry, I could n't trace my requirement in the URL : <a href="http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Customization.aspx">http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Customization.aspx</a>. </p><p>Reiterating my requirement: We use custom controls in our aplication. Hence, every string data must be displayed  using our own Text control (<strong>NOT </strong>using Silverlight control). Similarly every date time fields must be bound to our custom datetime control. </p><p>Is there a way to achieve this. Kindly help with source code if possible.</p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1979 Satish http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 16 Jul 2009 12:29:56 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction @<span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl16_lblCommentAuthor">Satish: Yes, you can. You can see my article about customizing DataForm control - <a shape="rect" href="http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Customization.aspx" shape="rect">http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Customization.aspx</a></span> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1962 boyanmihailov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Wed, 15 Jul 2009 21:08:50 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Is there is a way in Dataform to specify the control (Custom control instead of standard textbox control for a string property) of my choice, that would be created dynamically for each of the property? http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1955 Satish http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Wed, 15 Jul 2009 14:23:21 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Nice, simple example without window dressing.   Congrats! http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1585 Richard http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Wed, 20 May 2009 14:29:15 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction AMAZING !<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1548 Keith http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 08 May 2009 16:37:04 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Hey Jarred: Did you try this: <p>ObservableCollection<Dictionary<int, string>> collection = new ObservableCollection<Dictionary<int, string>>();</p> <p>dataForm.ItemsSource = collection;</p> <br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1542 Waqas http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Tue, 05 May 2009 10:39:10 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction <p>@<span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl02_lblCommentAuthor">Cris: You can customize everything :) In my next articles I will show you how you can change the entire style of the control and how you can specify your own validation rules and messages.</span></p> <p><span>@Jared: It depends on your necessities. The DataForm control gives you a lot built-in features. You can change everything of its UI. I have not worked with "Observable Dictionary", but here is what I found - <a shape="rect" href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/2ec0c111-0682-49c8-a9d8-ae374328ea2e/" shape="rect"><span style="color: #1ca0f2">http://social.msdn.microsoft.com/forums/en-US/wpf/thread/2ec0c111-0682-49c8-a9d8-ae374328ea2e/</span></a></span></p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1512 boyanmihailov http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 24 Apr 2009 03:08:46 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Also, while Observable Collections are nice, is it possible to make this work with a Dictionary<> Type? <p> </p> <p>(For that matter, has anyone worked out an "Observable Dictionary" Type?)</p> <br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1511 Jared Thaler http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 24 Apr 2009 02:55:43 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Very Nice. <p>While, unfortunately, this will be next to useless for my main program (the user interface is vastly more complex than this would appear to natively support.)  It should cut dev time on the Admin Backend by at least a quarter. </p> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1510 Jared Thaler http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Fri, 24 Apr 2009 00:36:41 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction And how can we customize the labels? or even the error messages? any thought about it? http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1508 Cris http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 23 Apr 2009 18:34:25 GMT RE: Creating Rich Data Forms in Silverlight 3 - Introduction Thanks for the tutorial! I didn't know this existed in Silverlight 3.<br /> http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx#comment1504 Josh http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx Thu, 23 Apr 2009 10:17:25 GMT