SilverlightShow: Building a Silverlight Line-Of-Business Application – Part 6 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: Building a Silverlight Line-Of-Business Application – Part 6 I know you said that you prefer dealing with objects over DataSets, but for anyone that doesn't and/or you are interested in seeing some sample code for this in VB.NET you can check out this <a href="http://www.withvb.net/tutorials/vbnet-console-app-reads-xml-dataset">tutorial on XML DataSets with VB.NET.</a> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment5987 Matt http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 26 Apr 2011 20:53:24 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Peet</p> <p>I noticed that you posted this as a question on StackOverflow - it's probably best to continue the discussion there: <a href="http://stackoverflow.com/questions/4561922/localreport-webforms-and-partial-trust-for-pdf-generation">http://stackoverflow.com/questions/4561922/localreport-webforms-and-partial-trust-for-pdf-generation</a>.</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment5216 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 03 Jan 2011 08:20:14 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hey, love your article.</p> <p>The only bummer is that LocalReport (Microsoft.Reporting.WebForms) requires full trust, and our hosting server does not allow full trust.</p> <p>Do you know of any quick workarounds?</p> <p>Thanks,<br /> Peet</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment5180 Peet http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 29 Dec 2010 18:32:41 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Can you guys check the app.  It appears to be down... http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment3323 Scott http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 29 Mar 2010 22:00:16 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 The demo provided by your link doesn't work.  I get a WebExeption on the remote server. http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment3321 Gary A http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 29 Mar 2010 14:29:27 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Chris, <p>Thanks.</p> <p> </p> Bryian Tan http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2695 Bryian Tan http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 19 Nov 2009 19:25:02 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Hi Bryan <p>Yes it's fine because Silverlight is run client side so this isn't an issue...</p> <p>Chris</p> <br /> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2694 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 19 Nov 2009 14:04:35 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Hello, You have a Global.cs file with a static class and few properties like  <p>  public static string UserName = "";<br />         public static string Password = "";<br />         public static string[] UserRoles = null;<br />         public static bool IsLoggedIn = false;</p> <p>I'm new to Silverlight, I was wondering if the application will function accurately in a multiuser environment. Looking forward to hearing your feedback. </p> <p> </p> <p>Thanks,</p> <p>Bryian Tan</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2692 Bryian Tan http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 19 Nov 2009 04:54:32 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Criss.</p> <p>I have a problem with a line in my app, traslate certanly topics of yoour app to my app, and result is this problem.</p> <p>Cannot implicitly convert type 'MyFirstApp.P2PServiceReference.TipoDictionaries' to 'MyFirstApp.Dictionaries.TipoDictionaries' </p> <p>C:\Documents and Settings\jcastrillo\Escritorio\MyFirstApp\MainPage.xaml.cs 77 52 MyFirstApp</p> <p>this error is in event completed arguments, if you have any idea for this error, please... help me... </p> <p> </p> <p>Thk and Excellent Post</p> <p>Sorry for my english.</p> <p> </p> <p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2545 Jesus Castrillo http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 13 Oct 2009 16:41:48 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Hi Adam <p>I'm glad you've found the articles useful.  Unfortunately now that I've started writing a book I've been a little sidetracked from finishing my styling articles and moving on to look at things such as the dashboard.  Next month I'll be doing a presentation at TechEd Australia which I'll finish off the dashboard for.  It depends what you want to do anway, most of the structure is already in the project.  You just need to fill those panels - probably with graphs using something like the Silverlight Toolkit.  I don't know of any other good examples unfortunately except for those by third party control companies - you might want to look at Telerik, ComponentOne, Infragistics, and DevExpress - I think a couple of their sample applications include dashboards.  Hope this helps.</p> <p>Chris </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2246 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 17 Aug 2009 21:43:52 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Chris,</p> <p>Thanks for the sample. You probably has been thanked enough. I just would like to add my voice to great job.</p> <p>I want to play with the dashboard. Do you have any sample or a link to sample good.</p> <p>Adam</p> <p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment2244 Adam http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 17 Aug 2009 18:16:49 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi can anyone give me solution for this . When i run application in my local system its throwing error </p> <p>Cannot open database "AdventureWorks" requested by the login. The login failed.<br /> Login failed for user ""</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1874 Bobby http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 09 Jul 2009 14:11:15 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi <span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl60_lblCommentAuthor">ecfreitas,</span></p> <p><span>Part 7 is available and you can read it here: <a href="http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Styling-Part-1.aspx">http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Styling-Part-1.aspx</a></span></p> <p><span>Ilia</span></p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1446 iiordanov http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 09 Apr 2009 02:38:51 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 Great articles! I was hoping part 7 would already be available! Or the lauching of Silverlight 3.0 Beta have meddled with the original plan? http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1445 ecfreitas http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 08 Apr 2009 17:02:32 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>I can't tell you how invaluable these articles have been - thanks very much for all your time and effort, it's helped me out enormously!</p> <p>Emma</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1128 Emma http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 05 Mar 2009 10:07:39 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi David</p> <p>I haven't come across this error, but my guess is that it's to do with the connection string you have in the web.config file (AdventureWorksEntities).  The connection strings are a bit different for use with the entity framework so make sure you're using the right connection string format.  If it is correct you should be able to open up the AdventureWorksModel.edmx file and update the model from the database with no issues.  Otherwise this is probably your problem.  Part 7 is very close and has been quite a bit of work - look out for it in the next week or so...</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1118 Chris Anderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 03 Mar 2009 09:28:58 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Chris</p> <p>Great article and application! When is part 7 coming. I may have missed this in previous aticles but when I try an run your app and create an AdventureWorksEntitiesObject I get the following error "Keyword not supported: 'data source'." The database does exist and I have got the membership part working. I can only think that this error is masking some other error being thrown in the "EntityClient" provider.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1112 David http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 02 Mar 2009 04:33:37 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Cris,</p> <p>Thanks the response!  I'm  eager to see the next version of  your AWLOB :) .</p> <p>Istvan </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1080 Istvan http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Fri, 20 Feb 2009 11:15:07 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Istvan</p> <p>Thanks for your feedback.  I see what you mean with the memory usage rising, but it's a bit confusing.  I'm not seeing the same effect when I look at the memory usage through Silverlight Spy which makes me think it's the browser holding onto objects not the Silverlight application.  There have been reports of memory leaks in the agDataGrid which may be the culprit - I need to update to the latest version which I'll probably do with the next article and see if that resolves the issue.</p> <p>Regards</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1058 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Sun, 15 Feb 2009 09:44:35 GMT RE: Building a Silverlight LOB Part 6 - memory leak <p>Hello Cris!<br />  I love your article-series very much, thank you for it!<br /> Your approach is very attractive, and you  have settles in all chapter (almost :) ) just I need, and I have missed everywhere where I looked for. <br /> But, personally I would have prefer the explanation of  the code sometimes more deeply.</p> <p>Moreover  I'm afraid there is a memory leak! Every time one goes  to the detail page and back,  the IE memory-consumption grows up approx.  5 MB  in the demo site version  and the local version too.  Unfortunately I am quite newbie in .Net  programming, so I no have idea where  the problem is.</p> <p>Istvan</p> <p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1030 Istvan http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 09 Feb 2009 04:39:32 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>Thanks for your comments, and I can explain a few reasons why it's currently the way it is that doesn't make it completely testable as is.  To start with it would be best to use the M-V-VM pattern which you've probably seen mentioned around the place, as it structures the project more appropriately to implement testing.  When I wrote the first article it was my first attempt at writing a XAML based application and wasn't aware of that pattern as being the ideal pattern to use.  It's my plan to migrate to that pattern in the near future, which would be required before I can write an article on testing.  This is probably the greatest impediment in implementing testing, though I don't think it would be a lot of work to retrofit the application to use this pattern.  Things like the business objects should be reasonably easy to write tests for without major changes.  Possibly the complexity and major redesign issues that your team were describing would be to implement dependency injection and inversion of control to support the TDD process, which would require a certain amount of redesign.  Being an Agile/TDD team as you describe them I'm guessing this is what they are indicating.  When writing this series of articles I had to choose a line to walk between implementing enterprise hardcore design methodologies (which would just be too much to take in for many developers and remove the focus from solving the Silverlight specific issues I was targeting), or provide a simpler design that more developers could follow and use - which required sacrificing some higher end architecture principles and methodologies.  Since I was really focusing on Silverlight as the technology I did end up choosing the low road as such which wouldn't endear my project/framework sample to Agile/TDD purists.  I plan to introduce more solid methodologies as I go, which will require a certain amount of retrofitting, but then again you need to choose the right methodologies for the project (and not just using them for using them's sake), and not over-architecture the application (this may depend on the size/structure of your team and the size of the project).  I may end up having a couple of frameworks even, each targeting support for different methodologies.  So I see the framework as it is as a reasonably solid basis to work from, solving problems you will face however you structure your project and whatever methodologies you use, and you can go from that.  Definitely I'm not 100% happy with the framework currently and would like to move to a M-V-VM structure in the near future which will solve some of the testability issues.  This is an evolving project/framework and I welcome all feedback to improve it :).  If you have any other details or would like to discuss further you can go to the contact page on my blog (<a href="http://chrisa.wordpress.com/contact">http://chrisa.wordpress.com/contact</a>) and send me a private message.  Thanks for your feedback...</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1016 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 04 Feb 2009 12:09:52 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Chris,</p> <p>Just a thought about adding automated testing to your application.  I had an Agile/TDD team at my company review the app that I stole from you and modified for my proof-of-concept.  I wanted them to help me add unit testing, but it turns out that unless you start with tests first, it is very difficult to add them later.  As I'm starting to understand, making your app testable requires a certain design and the use of interfaces and abstractions that we usually wouldn't bother doing.  I was told it would be easier to redesign rather than retrofit with tests.  I might be telling you something you already know, but I just wanted to pass that on.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1012 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 03 Feb 2009 22:35:22 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>As of todat (02/02/2009) still getting an invalid username & password when trying to login using demo & demo.</p> <p>Cheers</p> <p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment1003 Ken http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 02 Feb 2009 12:05:05 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Neil,</p> <p>The demo account was locked because of multiple inputs of invalid usernames/passwords, but now it is unlocked again.</p> <p>Cheers</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment983 iiordanov http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 29 Jan 2009 07:51:39 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Great article and looks prefect for what I'm looking for. Though when I try and view your demo, I'm getting an invalid username & password when trying to login using demo & demo.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment982 Neil http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Thu, 29 Jan 2009 07:37:09 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Sarah</p> <p>Thanks for your feedback.  Workflow is a very common element in line of business applications, and was on my list of topics though it hadn't been put assigned to a particular article as yet.  It will be coming up at some stage, so thanks for letting me know your interest in it.  Displaying Exchange emails might be an interesting topic, though I hadn't considered it up until now.  I'm probably unlikely to be covering that any time soon however I'm afraid due to the complexity of writing that so it could be used in a demonstration scenario, though if there is enough demand I might decide to do so.  Almost all business applications I've developed have had the concept of notes or messages that are added to the system when there has been a discussion with a client, a decision made, etc, which is a feature I did have on my list that might be similar to what you are after.  If you are looking to integrate directly with Exchange there are a number of possible solutions.  If you're using Exchange 2007 there is a new web service api that comes with it that might be best.  For previous versions you can use WebDAV to obtain data via an HTTP call.  Or you could just use CDO in your WCF service and return the results that way.  I'm not really a fan of master-detail type forms myself but I am likely to be demonstrating some sort of master-details implementation when I get to the Administration article purely because it is used quite often as a UI pattern.  Personally I don't find it to be very intuitive for users and prefer to display "detail" data in a popup or separate page.  That's just my preference though - but it does have its place so I will cover it anyway.  Expanders aren't a part of the standard controls in Silverlight, but there is an implementation in the Silverlight Toolkit that I plan to cover in the near future (probably in the Administration article).  Thanks for your feedback!</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment979 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 28 Jan 2009 10:47:50 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>Thanks again for your input and I'll take it on board - proper testing is vital in developing robust software and deserves a thorough discussion as a part of this series.</p> <p>I don't think I'm the only person in the world who knows how to build an end-to-end business application, but I do believe I'm the only person writing extensively about the process.  This series was designed to fill that void, because I couldn't find (as you say) any more than just bits and pieces.  I have to say that along the way there have been many many hours of research and experiementation to get to this stage as many of the topics I discuss just aren't documented or discussed anywhere.  If they are, again as you say they are bits and pieces and not particularly thorough.  I guess I had a bit of a beef seeing demonstrations of "line of business applications" in Silverlight which were nothing of the sort - to me a business application is more than just calling a web service and displaying the results in a grid, and I feel the term is grossly misused in a lot of demonstrations and articles.  In addition important topics (including the "ComboBox nightmare") were totally ignored and you wouldn't know the problem existed until you hit it yourself.  Hopefully I've gone a bit of the way towards offsetting the imbalance by demonstrating real-world scenarios and solutions to the problems developers are going to experience.  There's still a lot more to cover, so stay tuned :).</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment978 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 28 Jan 2009 10:16:59 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Chris,</p> <p>Thanks for your advice re entity model and args class.  Regarding topics of interest, your original plan of dashboard, administration and styling will be very useful and is a good development sequence.  In addition I am interested in workflow particularly authorising stages of a process.  So a user enters information into a form which then needs authorising before the process can continue.  There would need to be some routing in case the authoriser is absent and the form needs to be routed to another person.  In the Microsoft Health CUI demo it shows the user's email within the interface.  Are you able to demo how to view Exchange/Outlook messages within Silverlight?  A topic that I am struggling with is how to display multiple information parts on the same page (master/detail).  For instance one form I have lends it self to having a list box displaying the no of the form which when selected displays the form detail consisting of background information and the a two grids with details of invoices and budgets.  An example of using expanders or accordions would be useful or an alternative way of drilling down to the information. </p> <p>As Jon says above <em>'anything we get from you is always much appreciated.'</em>'  Thanks, Sarah.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment976 Sarah http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 28 Jan 2009 03:30:00 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Chris - my 2 cents would be to prioritize the testing/unit testing framework only because TDD mandates that the testing happens early, not as an afterthought.  Of course, this is just a school of thought but it does seem to be the trend - at least here in the states.  Personally, I like silverlight because of the apparent ease in creating unit testing in compiled code vs javascript on the client.  That said anything we get from you is always much appreciated.  </p> <p>So - are you the only person in the whole world who knows how to create an end-to-end business app using silverlight  and not just bits and pieces?  Based on what I've seen and read I think so ; )</p> <p> </p> <p>Jon</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment974 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 27 Jan 2009 12:25:23 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Sarah</p> <p>Unfortunately it could be any number of things and it's a bit difficult to identify the issue without all the code.  In your select linq statement is the PAN entity and the PANno field coming up in your intellisense?  It's possible your entity model requires modification to ensure there is a relationship in your model.  Have you tried updating your model from the database?  The compiler won't find the args class if the WCF service isn't compiling (which it sounds as though it isn't.  Sorry I can't be of more help.</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment972 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 27 Jan 2009 10:03:33 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>I hope you get the bug solved with the Telerik grid - let me know if you do.  Telerik seem to be very good with their support, and it's good to see they're working with you on this.  Good to see that you've been extending the project and filling in the dashboard - that's an article I have planned coming up.  Testing is another article I have plans for, but that's a little bit away at the moment as I've been sidetracked with work lately.  I have a whole raft of topics to talk about but due to the sheer amount of effort each one takes there is a bit of a delay between them at the moment.  I'm also very interested in what other people are wanting information on in building a business application so fire away with any topics you'd like me to cover.  Chances are they'll already be on my list but based upon demand I can reorder them a bit.</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment971 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 27 Jan 2009 09:57:08 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Chris,</p> <p>I am trying to add some LINQ to query the entity framework.  In the entity model I have a table project that is linked to another table PAN by projectID.  The mapping is defined and it is a one to many relationship (1 project has many PANs).</p> <p>IQueryable<ProjectsBO.PAN> qry = from p in context.Project.Include("PAN")<br />                                                  where p.projectID == ProjectID<br />                                                  select new ProjectsBO.PAN<br />                                                  {<br />                                                      projectID = p.projectID,<br />                                                      PANno = p.PAN.PANno,</p> <p>};<br />                 return qry.ToArray();</p> <p>but get the following error:</p> <p>Error    3    'System.Data.Objects.DataClasses.EntityCollection<CDWeb.PAN>' does not contain a definition for 'PANno' and no extension method 'PANno' accepting a first argument of type 'System.Data.Objects.DataClasses.EntityCollection<CDWeb.PAN>' could be found (are you missing a using directive or an assembly reference?)    C:\sandbox\CDWeb\CDWeb\CDDataService.svc.cs    770    68    CDWeb<br />  </p> <p>I have successfully done this with other tables in the database but they were also a struggle to get working and when they did I didn't know why they had succeeded.</p> <p> </p> <p>I also have added the following code to a form page:</p> <p>        private void SaveProject()<br />         {<br />             if (PageStatusChange != null)<br />                 PageStatusChange(this, new PageStatusChangeArgs(PageStatusChangeArgs.eStatuses.RetrievingData));<br /> <br />             CDDataServiceClient service = CDServiceFactory.GetService();<br />             service.SaveBidAssessmentCompleted += new  EventHandler<SaveBidAssessmentCompletedEventArgs>(CDDataService_SaveBidAssessmentCompleted);<br />             service.SaveBidAssessmentAsync(m_currentBid);<br />         }<br /> <br /> <br />         private void CDDataService_SaveBidAssessmentCompleted(object sender, SaveBidAssessmentCompletedEventArgs e)<br />         {<br />             if (PageStatusChange != null)<br />                 PageStatusChange(this, new PageStatusChangeArgs(PageStatusChangeArgs.eStatuses.Active));<br /> <br />             if (e.Error != null)<br />             {<br />                 MessageBox.Show("An error occurred saving the bid assessment: " + e.Error.Message);<br />             }<br />             else<br />             {<br />                 // Update this product object with the new ID assigned<br />                 //m_projectID = e.Result;<br />                 m_currentBid.projectID = m_projectID;<br />                 DeleteButton.Enabled = true;<br />             }<br />         }</p> <p>and the compiler doesn't find a definition of SaveBidAssessmentCompletedEventArgs.  I have hacked the auto generated reference.cs file to add this definition but of course when you update the webservice this gets overwritten.</p> <p>Would you know what steps I am missing?  Many thanks, Sarah</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment962 Sarah http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 27 Jan 2009 03:48:20 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Ah - so the key was the  <font color="#2b91af" size="2"><font color="#2b91af" size="2">ContentProperty</font></font><font size="2">(</font><font color="#a31515" size="2"><font color="#a31515" size="2">"TargetControl"</font></font><font size="2">)] attribute.  Setting that made the property "the" way to set the content.  Nice find.  Thats some nice code you worked up for the field validation.  You obviously know your stuff.  Makes me wonder why the MS team couldn't have come up with something similar already.</font></p> <p>At this point I'm quite certain that my bug is a Telerik problem.  I'm working with their beta datagrid and have been pointing out the problem, which they have been prompty responding to.  Only problem is that every time they fix one thing they break another.  Good news is that I don't think it affects the AGDataGrid or the standard grid.  I've finally managed to use that blacklight dashboard page to populate 4 datagrids that represent ticket queues.  Each grid is on a timer that asynchronously pulls data down from a WCF call and populates the grid on a specified interval.  Very cool bit of functionality that works with no flicker or disruption.  Here is a good article on how to do that...</p> <p><a href="../../items/Tip-Asynchronous-Silverlight-Execute-on-the-UI-thread.aspx" target="_blank"><span id="lw_1233021810_0" class="yshortcuts">http://www.silverlightshow.net/items/Tip-Asynchronous-Silverlight-Execute-on-the-UI-thread.aspx</span></a></p> <p><span class="yshortcuts">So, do you plan on doing anything with unit testing?  We are about to kick off our project (officially) and are taking a TDD approach.  Not sure if you dabble in such things.</span></p> <p><span class="yshortcuts">Jon</span></p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment961 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 26 Jan 2009 21:07:05 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>I went back and looked at the previous article where I described the Validator control implementation and found that I didn't actually touch on this point ,so thanks for pointing it out - I'll need to do an update to that article.  If you don't know where to look when trying to follow the logic through it seems like it's happening by magic as you say :).  Essentially by making the data entry field control a "child" of the validator you are assigning its Content property.  I added the following attribute to the class in the code behind:</p> <p><font size="2"> <p>[</p> </font></p> <p><font color="#2b91af" size="2"><font color="#2b91af" size="2">ContentProperty</font></font><font size="2">(</font><font color="#a31515" size="2"><font color="#a31515" size="2">"TargetControl"</font></font><font size="2">)]</font> <p>By doing this, a reference to the direct content of this user control (without requiring any intermediate properties) will be automatically assigned to the specified property (in this case a reference to the data entry field control).  It's an alternative to the user needing to write their markup with an intermediate property, so they can do something like this:</p> <p><Validator ....><TextBox /></Validator></p> <p>instead of:</p> <p><Validator ....><Validator.TargetControl><TextBox /></Validator.TargetControl></Validator></p> <p>Much cleaner from a XAML perspective, but trying to work it out without knowing the trick can make it a bit difficult to understand.  I intended on writing a bit about that (because it's not well documented if you do a Google search) but slipped my mind.  Hopefully I explained it well enough here - and at some stage I'll update the article to explain it a bit better.  Thanks for pointing out this omission.</p> <p>Did you manage to track down any more details about that error?</p> <p>Regards</p> <p>Chris</p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment956 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 26 Jan 2009 03:59:23 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Chris - for the life of me I cannot figure out how you created the TargetControl property in the FieldValidator class.  More specifically, how does TargetControl setter know that it should set the property to the child control?  I cannot see anywhere that the TargetControl is explicitly set.  How are  you pulling off this magic?  </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment952 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Sun, 25 Jan 2009 17:10:28 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>Thanks for that.  This is a curly one!  It could be similar to the error I mentioned I'd seen a couple of times though I honestly can't remember exactly what it was as I haven't seen it recently (and hoped it had gone away).  I was hoping to use the stack trace you provided to narrow down the issue using Reflector but I don't think it will be much use.  The stack trace indicates that the Telerik DataGrid for some reason at that point is trying to do some calculations in order to work out how to draw itself, even though it should longer be displayed (which is likely to be the reason for the error).  Are you experiencing the exception randomly or is it easily reproduceable?  If so, what needs to be done is a simple cutdown sample application that reproduces the problem with some regularity and then it can be submitted as an issue to community members such as myself and possibly on to Telerik or Microsoft Connect if it is their issue.  My guess is that the cause of the randomness is that it might take a varying amount of time to hide the control on the form, or that the garbage collector sometimes kicks in quickly, and based upon the stack trace it's then trying to calculate something for the display of the grid, but being hidden or disposed it's an invalid calculation.  Very hacky, but maybe catch the Closing event on the "page" control and set the visibility of the DataGrid to hidden to possibly disable this calculation?  Pulling at straws but it could resolve the issue. Have you tried Telerik support?  Based upon the stack trace the exception is due to the Telerik control trying to calculate its visual aspects after it is hidden/disposed or an ancestor in the visual tree is hidden/disposed - they may be able to track it down for you.  If you have the source code for the DataGrid you might be able to link it in as a project and try to understand why the functions in the stack trace are being called which generate the exception.  Sorry I can't be of more help - I'm pretty much guessing at this point, but hope it might give you some ideas to work with.</p> <p>Regards</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment938 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Tue, 20 Jan 2009 04:48:43 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Forgot to add:  I'm using the latest framework though I've added some modification to enable caching of those pages.  The problem though is with the removing of control from page.xaml which i have not modifed.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment936 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 19 Jan 2009 21:20:34 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>I'm building this framework for a ticketing app.  When a pharmaceutical sales rep calls in with a IT related issue, say a laptop issue, this app is used by the level 1 call rep to track and route the problem.  Yes the Telerik controls are nice, albeit still not ripe.  The nice thing is they have constant releases and a really nice treeview control which is critical to my app since it supports a problem category taxonomy.  Not to mention, I avoided the combobox nightmare scenerio ; )</p> <p>The only thing I could find on the forums that make sense about this error seem to point to UI elements being disposed too quickly.  If I call the same code through a button click instead of a grid select event the problem does not happen.  Here is the forum post if interested (see last entry):</p> <p>http://silverlight.net/forums/t/18983.aspx</p> <p>I also posted on the forum and got some vague advice about using the Dispatcher.BeginInvoke but that didn't work.</p> <p>http://silverlight.net/forums/t/66413.aspx</p> <p>Here is the call:</p> <p>private void RadGridView_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)<br />         {<br /> <br />             customer = CustomerGrid.CurrentItem as CustomerBO.Customer;<br /> <br />             if (CustomerChange != null)<br />                 CustomerChange(this, new CustomerChangedArgs(customer));<br /> <br />             if (NavigateRequest != null && customer != null)<br />                 NavigateRequest(this, new NavigateRequestArgs(Globals.PAGE_CUSTOMER_PROFILE, null));<br />  <br />         }</p> <p> </p> <p>and the error:</p> <p>Unhandled Error in Silverlight 2 Application Value does not fall within the expected range. at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual) at System.Windows.UIElement.TransformToVisual(UIElement visual) at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.ScrollHorizontallyIfNeeded(UIElement visual) at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MakeVisible(UIElement visual, Rect rectangle) at Telerik.Windows.Controls.GridView.GridViewScrollViewer.HandleCellRequestForBringIntoView(UIElement focusedCell) at Telerik.Windows.Controls.GridView.GridViewScrollViewer.HandleRequestForBringIntoView(Object sender, RadRoutedEventArgs e) at Telerik.Windows.RadRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target) at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs) at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs) at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain) at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args) at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args) at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e) at Telerik.Windows.Controls.GridView.GridViewCell.OnGotFocus(RoutedEventArgs e) at System.Windows.Controls.Control.OnGotFocus(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)</p> <p> </p> <p>It doesn't actually cause too much grief, except the debugger gets hung up on the error and I can't proceed.  I think it might represent more of a design flaw on my part since I'm removing a page that has an "active" component.  But then why just the grid and not a combobox, for instance.  Anyway, I'll keep plugging on this since I can't come up with a work-around and let you know if i'm successful.</p> <p>Thanks</p> <p>Jon</p> <p> </p> <p> </p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment935 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 19 Jan 2009 21:17:50 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Jon</p> <p>Good to hear my framework has been of help to you - I'd love to see what you (or anyone else) produces based upon it.  Because it's open source I'm stuck to freely available controls but I think you've made a good move to use some third party controls to save some of the headaches I encountered,  Are you able to tell me what the error (plus stacktrace) is that you're receiving and if there is a set way to reproduce it with the online demo?  It could be the elusive bug I've seen on a couple of occasions but not been able to reproduce (which makes me think there could be something weird going on in the Silverlight runtime) and hasn't as yet been reported by anyone else.  Much like you say the app can suddenly throw an exception when changing a page.  I've just spent some time clicking around randomly trying to reproduce it without any luck.  What version of the framework are you using - is it this one where a new Closing event was implemented or before that?  I haven't seen this bug recently but would love to track it down as I'm not a fan of random bugs.  Let me know if you come up with something.  If anyone else has experienced this bug please let me know - I was hoping it was just something in the development/debugging process that was causing it.</p> <p>Thanks</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment930 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 19 Jan 2009 05:02:22 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Really good stuff - thanks for keeping up with it.  I am using your source as a framework for an app I'm trying to prove out with Silverlight.  I've deviated slightly by using some 3rd party controls to avoid some of the headache you encountered.  One of the issues that I'm finding is that when i'm using the grid to navigate to another page i'm getting some ugly errors.  I think this occurs because i'm responding to a grid event but then removing the UserControl parent.  This has happened with both the standard datagrid and a 3rd party grid.  I've even noticed it happens on the AGDatagGrid in  your app when clicking on an inventory item to update, though only rarely.  Have you encountered this issue yet?</p> <p>Thanks</p> <p>Jon</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment928 Jon http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 19 Jan 2009 00:18:03 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>Hi Andrus</p> <p>As FYI Reporting produces RLDC reports you would use it exactly the same way as described but develop the report in the FYI Reporting designer.  You would not be able to use the designer within your Silverlight application as it is WinForms based.</p> <p>Chris</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment890 chrisanderson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Sun, 11 Jan 2009 09:24:06 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>how to use open source <a href="http://fyireporting.com/">http://fyireporting.com</a></p> <p>SilverLight report viewer and WinForms designer from this SL application ?</p> <p>In uses RDL format also.</p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment889 Andrus http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Sat, 10 Jan 2009 10:59:07 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>This is really helpful. We're building a Silverlight 2 collaboration application called:</p> <p><a href="http://colaab.com" title="colaab - online collaboration in real time or your own time">colaab.com</a></p> <p>Into which we need to introduce some reporting functionality for customer invoices and suchlike. I was considering Reporting Services reports and it's great to have such a detailed description of how to go about it.</p> <p>Thanks,</p> <p>Bob</p> <p><a href="http://stormideas.com">stormideas</a></p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment884 Bob Thomson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Wed, 07 Jan 2009 15:55:40 GMT RE: Building a Silverlight Line-Of-Business Application – Part 6 <p>I can't wait for a SQL Reporting viewer for Silverlight.</p> <p>VinSolutions<br /> <a href="http://www.vinsolutions.com/DealerSites.aspx">dealer website design</a></p> http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx#comment878 Matt Watson http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx Mon, 05 Jan 2009 20:29:14 GMT