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

Top 5 Contributors of the Month

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.


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.


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.


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


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


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.


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







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


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



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.


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.


Add the following Context and use it as shown below:


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


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.


Hope this article helps for the beginning.

 Subscribe to Articles


Further Readings:


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