Tek Freak
jake of all trades

***** WISH YOU A HAPPY NEW YEAR *****

In this post, we’ll create a simple, LightSwitch ‘Character  Casing” TextBox. This extension will allow us to set following ‘case’

  • Normal
  • Upper Case
  • Lower Case
  • Proper Case
  • Title Case
  • Sentence Case


Read the rest of the entry »


 

Introduction

This simple group layout extension consists of two controls: ImageLayout & BrushLayout; helps users to set its background.

FullSS


Read the rest of the entry »


Introduction

This walkthrough will demonstrate how to create A very simple Button Control extension that consists of two controls; helps users to attach PNG image to their buttons.  ImageButton – this control will allow you attach just an image to the button. ExtendedImageButton – will also show “Display Name” text and wraps.


Read the rest of the entry »


Tags: , , ,

My mentor,

My guru,

May Rest In Peace

 


Problem : LS allows a master record to be deleted (in screen) even though the entity has few children exist with “Restricted” relationship between them.  But it generates the validation error when we try to save the entity and there is no way to get rid of them (by design).

Summery : In LS “Beta2″ days, I posted a bug and acknowledged by LS Team. Now I created a project to see if this bug was cleared. It actually did (now LS assigns “1″ as a starting number of ID entities), but found another issue with it.  And I’m not sure, whether this one was pre-exist in Beta2 or not.

On Screen Level, even if my entities’ relationship has ‘Restricted’ deletion, LS actually allows to delete the Master record when there are child records exist and it catch this when the records are trying to post back to DB with SAVE method.

If we try to delete an “existing Master record”, at least now we have a choice to go back and delete the child records one-by-one on the screen, as LS put a “X” icon next to the master record, but at least it still exist in the screen.

But if we delete a newly added master record with children (that are not exist in DB), now LS clears the master/child records from the SCREEN and there is no way to get rid of its validation errors, when we try to SAVE the screen.

You can see these series of screen shot of what I mean.

This slideshow requires JavaScript.

Workaround : Right now, all what I did was restrict Master’s deletion method by overriding its code with below.  What I expect from LS is that, it should capture this ‘Restricted’ association on the screen and should prevent deletion.

[sourcecode language="csharp"]
partial void TempProductListDeleteSelected_CanExecute(ref bool result)
{
if (TempProducts.SelectedItem == null)
return;
if (TempProducts.SelectedItem.TempOrderDetails.Count() > 0)
result = false;
else
result = true;
}
[/sourcecode]

Discussion Threads

https://connect.microsoft.com/VisualStudio/feedback/details/686639/bug-in-master-detail-deletion#details

http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/e65b634e-c1f2-471e-9a8c-33507cd59020

http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/081099b2-4365-4a30-8914-68a6566e7600

 

 


Difficulty : Beginner


Summery: 
This is a stripped version of JaimeH’s MSDN’s code sample.  All credit goes to him. :)  I’m following Slideshow presentation idea from my previous post and matched the bullet points with it.  Hope this article may help someone.


Problem: 
How do you create a self/circular reference table and not to show the current record on its ‘drop down’ control?  For example, you have a Category Table with a ParentCategoryId that reference itself (which should allow NULL).  Now when you assign a Category for it, you may don’t want to allow the same Category to be assigned to itself.


Read the rest of the entry »


Tags: , , , ,

This slideshow requires JavaScript.

Summary:

This post will show you how to call a 3rd party web service methods from LightSwitch using WCF RIA.  For this demo post, I chose WebserviceX.NET’s Zipcode WebService (http://www.webservicex.net/uszip.asmx)  and thanks to their service. I have matched the bulleted points with Slideshow.

Read the rest of the entry »


Result

Result

Problem

I needed a Many-To-Many control that can help our users to relate hundreds of records between two master tables. Out of the box, LightSwitch (Beta 1/2) doesn’t support either Multi-Row Select Data Grid or provided a CheckedListBox.
LS provides one in-built solution for M2M: Auto Complete Box :- But this will take long time to add few hundred related data and requires multiple clicks per record. Also LS Team and community give two workarounds:

Read the rest of the entry »



Powered by Wordpress
Theme © 2005 - 2009 FrederikM.de
BlueMod is a modification of the blueblog_DE Theme by Oliver Wunder