Beginners Guide to Visual Studio LightSwitch (Part–5)
Visual Studio LightSwitch is a new tool for building data-driven Silverlight Application using Visual Studio IDE. It automatically generates the User Interface for a DataSource without writing any code. You can write a small amount of code also to meet your requirement.
In my previous chapter “Beginners Guide to Visual Studio LightSwitch (Part – 4)” I guided you step-by-step process to create a List and Details screen. There I demonstrated you, how to integrate two or more tables inside a single screen.
In this chapter, I am going to demonstrate you of doing custom validation using Visual Studio LightSwitch. This time we will jump into writing some code to extend the functionalities.
Background
If you are new to Visual Studio LightSwitch, I will first ask you to read the previous three chapters of this tutorial, where I demonstrated it in detail. In my 3rd chapter, I discussed the following topics:
- Creating the List and Details Screen
- UI Screen Features
- Adding a New Table
- Creating the Validation Rules
- Adding Relationship between two tables
- Creating the new List and Details Screen
- Application in Action
In this chapter we learn how to write custom validation for our table fields. Read it and start implementing your own logic. A quick jump to code will be there (for the first time). Enjoy reading the tutorial.
TOC and Article Summary
In this section, I will Summarize the whole Article. You can directly go to the original article to read the complete content.
- Setting up the basic application
Here we created our basic LightSwitch application with new table. - Validating fields
This is the main point of this tutorial part. Here we discussed on the default validation and jumped into the code to extend the basic validation of a field. - See it in Action
This point is to demonstrate the implemented custom validation.
Complete Article
The complete article has been hosted in SilverlightShow.net including the first four chapters. You can read them here:
- Beginners Guide to Visual Studio LightSwitch (Part – 1)
- Beginners Guide to Visual Studio LightSwitch (Part – 2)
- Beginners Guide to Visual Studio LightSwitch (Part – 3)
- Beginners Guide to Visual Studio LightSwitch (Part – 4)
- Beginners Guide to Visual Studio LightSwitch (Part – 5)
As usual, never forget to Vote for the article. Highly appreciate your feedbacks, suggestions and/or any comments about the article and future improvements.
End Note
You can see that, throughout the whole application (for all the previous 4 chapters) I never wrote a single line of code. I never did write a single line of XAML code to create the UI. It is presented by the tool template automatically. It has a huge feature to do automatically. From the UI design to add, update, delete and even sort, filter all are done automatically by the framework.
Only in this chapter, I introduced the code with you to extend the validation rule. I hope, you enjoyed this chapter of the series too. Huge nos. of figures I used here, so that, you can understand each steps very easily. If you liked this article, please don’t forget to share your feedback here. Appreciate your feedback, comments, suggestion and vote.

Why not reach little more and connect with me directly on Twitter, Facebook and LinkedIn. I would love to hear your thoughts and opinions.