.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> Silverlight >> Post New Resource Bookmark and Share   

 Subscribe to Articles

RIA Services in Silverlight 4 Using VS 2010

Posted By:Diptimaya Patra       Posted Date: May 04, 2010    Points: 25    Category: Silverlight    URL: http://www.dotnetspark.com  

RIA Services in Silverlight 4 Using VS 2010. In this article we will see how we can filter a Textbox on Keyboard inputs. We will see how we can block Numeric input from Keyboard.
 

Introduction

In this article we will see how we can filter a Textbox on Keyboard inputs. We will see how we can block Numeric input from Keyboard.

Creating Silverlight Project

Fire up Visual Studio 2010 and create a new Silverlight 4 Business Application Project. Name it as RIASilverlight4Sample01.

clip_image002

After creating the Project, you would see a change in Solution Structure. I meant to say that different Layers are separated from each other using different Folders.

See the below figure for the Solution Structure in VS 2010.

clip_image004

We will have our own Page to the Project. Add A Silverlight Page to the "View" Folder, name it as Employee.xaml.

clip_image006

I have added the below XAML code to have the link button in the MainPage.xaml

clip_image008

We would add a DataGrid to the Employee.xaml page which will be useful for our need.

Now Add An Entity Model to the Web Project.

clip_image010

The following screenshots are for the reference how to proceed further. You can use it as step by step.

clip_image012

clip_image014

clip_image016

clip_image018

clip_image020

clip_image022

We would change the table and field names for easy use.

clip_image024

Add A Domain Service Class to the Web project and name it as "EmployeeDomainService".

clip_image026

clip_image028

If you are not getting any Entity Frameworks listed, then just press cancel and rebuild the Web Project. And do the above steps again.

You would see the EmployeeDomainService.cs file has all the methods related to CRUD operations. See the below figure


Change the GetEmployees method to below code.

clip_image032

Now Re Build the solution.

Building the solution generates the Domain Context and entities in the client project.

Open Employee.xaml.cs and add the following namespaces.

clip_image034

Add the following Context and use it as shown below:

clip_image036

I have changed the DataGrid's AutoGenerateColumns to False and made the IsReadOnly property to True. I have customized the columns structure as follows:

clip_image038

Now we are ready, run the application and click on the Employee Details Link on the top right. You would get the results as shown in below figure.

clip_image040

Hope this article helps for the beginning.


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend