Search This Blog

Loading...

Sunday, 31 March 2013

How to Integrate Telerik RadPivotGrid in LightSwitch 2012

Hi Everybody...

Data analysis is a crucial part in a business application. To represent huge amount of data we need a high performance analysis tool. Telerik Silverlight RadPivotGrid is one of them. Its really a powerful and high performance pivot grid control in the market.



Today I am going to show you how to integrate Telerik RadPivotGrid control in LightSwitch 2012.

Requirement

1. Visual Studio 2012 Professional or Higher
2. Latest Telerik Silverlight Control

Step-1
First I have created a LightSwitch C# project called "RadPivotGrid". And an entity called "Product". After that created two screens based on Product entity. One is Search Screen and the other one is Editable Grid Screen.


Step-2
By the help of Editable Grid Screen I inserted some demo data into the application.


Step-3
Created a Silverlight User Control ("RadProductPivotGrid") and add the following assemblies in the Client Project which is required to integrate the PivotGrid control in lightswitch.

Telerik.Pivot.Core
Telerik.Windows.Controls
Telerik.Windows.Controls.Pivot
Telerik.Windows.Controls.PivotFieldList

In the Xaml page (RadProductPivotGrid.xaml) write the below code.


<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot" x:Class="LightSwitchApplication.CustomControls.RadProductPivotGrid"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <pivot:LocalDataSourceProvider x:Key="LocalDataProvider" AggregatesPosition="Rows">
            <pivot:LocalDataSourceProvider.RowGroupDescriptions>
                <pivot:PropertyGroupDescription PropertyName="Name"/>
            </pivot:LocalDataSourceProvider.RowGroupDescriptions>
            <pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
                <pivot:DateTimeGroupDescription PropertyName="PurchaseDate" Step="Month" />
            </pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
            <pivot:LocalDataSourceProvider.AggregateDescriptions>
                <pivot:PropertyAggregateDescription PropertyName="Price" StringFormat="C" AggregateFunction="Average" />
                <pivot:PropertyAggregateDescription PropertyName="Quantity"/>
            </pivot:LocalDataSourceProvider.AggregateDescriptions>
        </pivot:LocalDataSourceProvider>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <pivot:RadPivotGrid x:Name="xRadPivotGridView" Grid.Column="0"/>
        <pivot:RadPivotFieldList Name="xradPivotFieldList" Grid.Column="1"/>
    </Grid>
</UserControl>

and in RadProductPivotGrid.xaml.cs page write the below code


public partial class RadProductPivotGrid : UserControl
    {
        DataWorkspace workspace = new DataWorkspace();
        public RadProductPivotGrid()
        {
            InitializeComponent();
            LocalDataSourceProvider dataProvider = (this.Resources["LocalDataProvider"] as LocalDataSourceProvider);
            workspace.Details.Dispatcher.BeginInvoke(()=>
            {
                dataProvider.ItemsSource = workspace.ApplicationData.Products;
            });
            this.xRadPivotGridView.DataProvider = dataProvider;
            this.xradPivotFieldList.DataProvider = dataProvider;
        }
    }

Step-4
Rebuild your project and Integrate your Silverlight Custom Control into LightSwitch Search Screen. Play the solution and see the Powerful RadPivotGrid control in action.



Conclusion
This is just a sample PivotGrid integration. Visit Telerik Official Silverlight Demo page to customize your pivot grid as per your requirement. Also I would like to thank to Paul Van Bladel for redirect me in right direction.

Hope you enjoy this.

Feel free to reply here if you got any doubt.

As Jan (LightSwitch Hacker) said Keep Rocking LightSwitch

Saturday, 5 January 2013

7 Most Easiest Way to Send Email from Lightswitch

Sending email from application is a key requirement for business app. As LightSwitch is the perfect platform for developing business application, So there are many ways to send email from LightSwitch also. You can send email from both server and client. I thing below are the 7 most common and easy way to send email from LightSwitch.


1. How To Send HTML Email from a LightSwitch Application (by Beth Maasi)
In this post you will found below three procedure to send email.
Sending Email Via SMTP Helper Class
Creating HTML from Entity Data
Sending Email via and Outlook Client.

2. Integrate Outlook in LightSwitch to send HTML Email (by Office Integration Pack)
Grid Logic's Office Integration Pack extension is a master piece for integrate lightswitch with Microsoft Office System. Therefore you can easily integrate Microsoft Outlook to send email from lightswitch application.

3. Send Email from LightSwitch (by Paul S Patterson)
Simple and easiest way to send email from lightswitch.

4. Send On Demand Email From LightSwitch Client (by Paul S Patterson)
Use this technique if you want to send email from client On Demand.

5. Send Email from Server using third party SMTP gateway SendGrid (by Paul S Patterson)
There are many third party SMTP relay server available in market to send email from business application writing less code. In this post you can able to see how Paul easily integrate SendGrid API in lightswitch server project to send email using SendGrid.

6. Send Email Attachment using DevExpress XtraReport from LightSwitch
By using DevExpress XtraReport for LightSwitch, you can able to send email with an attachment from lightswitch application. Follow the below tutorial to know more about it.
Send Report as an attachment using DevExpress XtraReport for LightSwitch

7. Generate PDF on the Server and Send Email (by Mr. Yossu)
In LightSwitch forum Mr. Yossu solve his own issue regarding how to generate pdf from server and send as an email. This is really a class technique to send email as an attachment from server.

Hope you enjoy this...

Have Fun with LightSwitch.

Monday, 31 December 2012

Inventory Management Application developed using LightSwitch



InventTrex is a computer-based system for tracking inventory levels, orders, sales and deliveries. It can also be used in the manufacturing industry to create a work order, bill of materials and other production-related documents. Companies use inventory management software to avoid product overstock and outages. It is a tool for organizing inventory data that before was generally stored in hard-copy form or in spreadsheets. It is often associated with and is similar to distribution software.

An inventory management application can be rich in features without having a bloated interface. We do it by letting you choose which features are displayed to each specific user. So while we offer plenty of features, your users won't be confused by having to view an application with tons of bells and whistles that don't apply to them...

Click here to know more...

Friday, 7 December 2012

How to Implement Custom KeyBoard Shortcut in LightSwitch Application


I think lightswitch community is rocking as expected. Ya, It should basically release of LightSwitch HTML Client Preview 2. Hmmm, Again good work by Microsoft LightSwitch Team. Many Thanks.

I would also like to thank MSDN team, due to selecting me for the MCC award program.

After a long time back, I was busy in my holiday session.

In today's article i am gonna show you on how you can implement custom keyboard shortcut in lightswitch 2012.

Prerequisite: Microsoft Visual Studio 2012 Professional or higher. Not yet tested in LightSwitch 2011.

For my current project there is a huge requirement of keyboard shortcut. So my target is, I have to implement it. I have Google and BING so many article about keyboard shortcut in Silverlight. What I thought If I can do in Silverlight then I can definitely do in LightSwitch Silverlight Client. Now my requirement is to focus on various TabItem located in my screen by pressing custom keyboard key. I think I have seen many LightSwitch Forum article where people have asked so many times. Why not this is also a requirement for faster data entry in Business Application. So I pulled my hair couple of time and start the magic. Here we go...


Monday, 1 October 2012

Apply Theme To LightSwitch XtraReport 2012

Here is a simple technique to change the ribbon theme of DevExpress XtraReport in LightSwitch V2 (Visual Studio 2012)

To know more about DevExpress Silverlight theme please visit the below link
DevExpress Silverlight Theme

Prerequisite
1. Visual Studio 2012 Professional or higher edition.
2. DevExpress XtraReport for LightSwitch 2012 (ver 12.1.7)

>