Visual Studio LightSwitch 2011 – Part 2

After creating our basic LightSwitch project in the last post, today we're going to add some real functionality.

To get warmed up, let's take a look at some contents of the project we created last time. At the top level, we see there's a new project type, along with some intriguing files:

Our project files

Drilling down a level further, we see a number of sub-projects (Client, Server, Common) contain C# files:

Under the hood, we see some C#

None of this should need to be edited manually, of course. Before adding some real capability to our app, let's take a quick look at the data-type imported when we connected to SharePoint:

Our DevTech Goal in the Designer

To add some "screens" (the moniker used for dialogs in the LightSwitch runtime environment), it's a simple matter of right-clicking the Screens item in the Solution Explorer and selecting Add Screen…:

Adding a screen

We then get to choose the type of screen (whether to view a single item or a list of items, create a new item, etc.) and configure its options:

Our list and view screen

This builds a default list-view plus details screen, which, when we see it in the Designer, is structured based on its data – there's no graphical design to manipulate.

The Designer doesn't focus on layout

When we're running the application – with its single, default screen – from the debugger, we get the very nice option to edit the screen during the debug process:

During debug we can edit the layout directly

When selected, we get to edit the layout with a very helpful preview capability:

In-debug screen customization interface

I won't go into the ins and outs of building the app, but suffice to say that I did some work to streamline the user interface for this application, and found it very interesting. After just a few hours of experimentation with an extremely powerful – yet straightforward – user interface, I was able to come up with a very elegant application for editing goals in our SharePoint system. And all without a single line of code (although I believe you can add some, if you really need to).

Here's a screenshot, with some blurring, to protect the innocent. 🙂

The final Goal Editor application

Now if only they'd address the many-to-many relationship issue… at which point I'd add an additional screen to create new goals, with their associated metadata. But still – a very interesting development system, all things considered.

2 responses to “Visual Studio LightSwitch 2011 – Part 2”

  1. You mentioned that Lightswitch is not able to do many-to-many relationships, but if you search for this topic it looks like there is a workaround for this scenario. It looks like you need to add this relationship after the wizard has finished. Did you look into this and try it for your application? I noticed in part 1 that you mentioned Lightswitch is not suitable for what you want to use it for since there is this limitation.

  2. The workaround seems to be to create a mapping table between fields. This may be an option for your own database structure, but I couldn't find a way to make that work with existing SharePoint data.

    If you've found otherwise, please post a link - I'd love to give it a try.

    In the end I was still able to create a usable app, but it just doesn't help with goal creation (more with querying and updating status information, later on).

    Kean

Leave a Reply to Kean Walmsley Cancel reply

Your email address will not be published. Required fields are marked *