Blogs

The Progress Bar - DevExpress XPF Blog

February 2011 - Posts

  • Using Ribbon and Docking in WPF and Silverlight – Webinar Now Available!

         

    If you missed my webinar yesterday, the recording is now available on the DevExpress Channel. In this webinar, we take a look at how to start with a WPF application, and use the DevExpress Ribbon Control and DevExpress Docking Control to create the user interface. Then the application is ported over to Silverlight simply by copy/pasting the XAML and adding a few namespace references to demonstrate the advantage of the common codebase used by all DevExpress XPF products.

    The slides, as well as the WPF and Silverlight projects have been attached at the bottom of this blog post.

    Click on the image below to watch the recorded webinar:

    DevExpress_Silverlight_WPF_Ribbon_Docking_Webinar

  • Ask DevExpress (XPF team) webinar now available

         

    If you missed the Ask DevExpress webinar with the XPF team earlier this week, the recording is now available on the DevExpress Channel. In the first segment of the event, I provide an overview of our Silverlight and WPF product roadmap for 2011.

    Click the image below to watch the video on the DevExpress Channel:

    Ask_DevExpress_Webinar_Video

  • Silverlight Grid Control – Custom Data Sorting

         

    Check out the following tutorial video on the DevExpress Channel that demonstrates how to apply custom data sorting to the DevExpress Silverlight Grid Control. We’ll first look at the default behavior, then see how a custom sorting rule can be applied to a specific column.

    Click on the image below to watch the video:

    DevExpress_Silverlight_Grid_Custom_Sorting_Video

  • Silverlight Grid Control – Custom Data Grouping

         

    Check out the following tutorial video on the DevExpress Channel that demonstrates how to apply custom data grouping to the DevExpress Silverlight Grid Control. We’ll first look at the default behavior, then see how a custom grouping rule can be applied and how to override the default text that is displayed on each group header row.

    Click on the image below to watch the video:

    DevExpress_Silverlight_Grid_Custom_Grouping_Video

  • Silverlight Grid Control – Video Training on How to Persist the Layout

         

    Yesterday, I posted a blog entry that described how to get started and persist the grid control’s layout information in the Silverlight isolated storage. If you’d like to see this in action and follow it along at your own pace, click the image below to check out the corresponding video on the DevExpress Channel:

    DevExpress_Silverlight_Grid_Layout_Persistence_Video

  • Silverlight Grid Control – Layout Persistence in Isolated Storage

         

    The DevExpress Grid Control for Silverlight allows you to save the layout information to a data store and reload it when required. This layout information can include the visibility, position and size of visual elements, filter, sorting, grouping and summary information and more. You may also specify which settings to save and restore as well as whether to save it into the isolated storage or as a separate XML file.

    This blog post (and a corresponding video – to be published) will serve as the first part of the tutorial, where we look at how to save the complete layout information in Isolated Storage and then reload it again at runtime. The next segment will cover how to specify only certain information to be saved and how to save it as an external XML file.

    So, to get started, I’ll use a Silverlight Application Project that already has its Data Model and Domain Service created to be bound to the Products Table of the Sample Northwind Database. This database is located on a local copy of SQL Server Express 2008.

    I like organization, therefore, let’s create the basic infrastructure of the application so that I can use buttons to save and restore the grid’s layout. To make this easy and flexible, I’ll use the DevExpress Layout Control to achieve this:

    DevExpress_Silverlight_Grid_Layout_Persistence

    The XAML is as follows:

    1. <Grid x:Name="LayoutRoot" Background="White">
    2.     <dxlc:LayoutControl Name="layoutControl1" Orientation="Vertical">
    3.         <dxlc:LayoutGroup Header="Layout Persistence Options" Name="layoutGroup1"
    4.                           View="GroupBox" HorizontalAlignment="Stretch">
    5.             <Button Content="Save Grid Layout" Height="23" HorizontalAlignment="Stretch"
    6.                     Name="button1" VerticalAlignment="Top" Click="button1_Click" />
    7.             <Button Content="Load Grid Layout" Height="23" HorizontalAlignment="Stretch"
    8.                     Name="button2" VerticalAlignment="Top" Click="button2_Click" />
    9.         </dxlc:LayoutGroup>
    10.         <dxg:GridControl HorizontalAlignment="Stretch" Name="gridControl1"
    11.                          VerticalAlignment="Stretch" AutoPopulateColumns="True">
    12.             <dxg:GridControl.View>
    13.                 <dxg:TableView AutoWidth="True" ShowFilterPanelMode="ShowAlways" />
    14.             </dxg:GridControl.View>
    15.         </dxg:GridControl>
    16.     </dxlc:LayoutControl>
    17. </Grid>

    There, the layout is done, the grid is bound to data, so let’s take a look at the code that’ll make it all work!

    1. ...
    2. using SLGridSerialization.Web;
    3. using System.ServiceModel.DomainServices.Client;
    4. ...
    5. using System.IO.IsolatedStorage;
    6. using System.IO;
    7.  
    8. namespace SLGridSerialization
    9. {
    10.     public partial class MainPage : UserControl
    11.     {
    12.         private ProductsContext _productsContext = new ProductsContext();
    13.  
    14.         string fileName = "gridLayout.xml";
    15.         string layoutFolderName = "gridLayout";
    16.  
    17.         public MainPage()
    18.         {
    19.             InitializeComponent();
    20.             LoadOperation<Products> loadOperation =
    21.                 _productsContext.Load(_productsContext.GetProductsQuery());
    22.             gridControl1.DataSource = loadOperation.Entities;
    23.         }
    24.  
    25.         private void button1_Click(object sender, RoutedEventArgs e)
    26.         {
    27.             IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
    28.             if (!file.DirectoryExists(layoutFolderName))
    29.             {
    30.                 file.CreateDirectory(layoutFolderName);
    31.             }
    32.             string fullPath = System.IO.Path.Combine(layoutFolderName, fileName);
    33.             using (IsolatedStorageFileStream fs = file.CreateFile(fullPath))
    34.             {
    35.                 gridControl1.SaveLayoutToStream(fs);
    36.             }
    37.         }
    38.  
    39.         private void button2_Click(object sender, RoutedEventArgs e)
    40.         {
    41.             IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
    42.             string fullPath = System.IO.Path.Combine(layoutFolderName, fileName);
    43.             using (IsolatedStorageFileStream fs =
    44.                 file.OpenFile(fullPath, FileMode.Open, FileAccess.Read))
    45.             {
    46.                 gridControl1.RestoreLayoutFromStream(fs);
    47.             }
    48.         }
    49.     }
    50. }

    Looks like a lot of code doesn’t it? It’s pretty simple really... all that’s required to save/load the layout to the file stream are the SaveLayoutToStream and SaveLayoutFromStream methods of the grid control. The rest is code to create the “plumbing” for the application.

    And that’s it! When you run the application, you can customize the grid, apply filters, sorting, grouping, etc... and save the information to the isolated storage. You can then undo or change your customization and restore the layout information based on the XML file saved in the “gridLayout” folder of the user store.

    You may also download a similar example from CodeCentral: http://www.devexpress.com/Support/Center/e/E2643.aspx

  • Silverlight Layout Control – Runtime Customization Features and Layout Persistence

         

    If you recall, Vlad had posted a blog entry about a month ago announcing the full runtime customization features for the Silverlight and WPF versions of the DevExpress Layout Control.

    I have put together a training video which demonstrates…

    • How to create a layout at design-time
    • How to enable and use runtime customization
    • How to persist the layout at runtime

    Click on the image below to watch the video on the DevExpress Channel:

    DevExpress_Silverlight_Layout_Control_Video

  • Silverlight Upload Control – Getting Started Video

         

    Check out the following training video that shows how to get started using the DevExpress Upload Control for Silverlight. This is the first video in a series and covers the basics of the control. We’ll take a look at how to customize the control in upcoming videos.

    Click on the image to watch the tutorial on the DevExpress Channel:

    DevExpress_Silverlight_Upload_Control_Video

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.