If you have ever worked on an application that displayed large amounts of data, one of the cornerstones of your application was probably a Data Grid control. At MIX 2008 we shipped the first preview of the Silverlight Data Grid and a preview of it in WPF was also shown.
Start a new Silverlight Application as outlined in my previous post.
When given the option, choose the default "Add a new ASP. If everything went smoothly in the previous step, your project should be loaded and opened to
(If you did not want this behavior, but rather wanted to choose your own columns, you can do this by setting the Data Grid's Auto Generate Columns property to false.
For information on choosing your own columns see my post on Defining Columns for a Silverlight Data Grid) The easiest way to customize the Data Grid is through a variety of properties.
The Items Source can be specified inline in XAML such as: However, it is more commonly set in code behind, which is what we will do in this example.
Step 2 A: Name the Data Grid and build Before we go to the code behind you will want to be sure to give the Data Grid a name such as "dg".The first step is to be sure that you file deployed on IIS is the same as the one that you have in your developer environment.This can be automated when a Post-Build condition like this: . Net code, you usually set your debugging type to Managed. The reason is that Silverlight is not server side but client side.Is Read Only & Can User Resize Columns These properties control if the end user can edit the data in the grid and if the columns can be resized.For instance if you set the following properties to the following values: You would get this: Now that you have the basics, enjoy using the Data Grid.If you are one of those people, then you have come to the right place.