diff --git a/PivotGrid/CustomContextMenuBehavior/AllOrders.cs b/PivotGrid/CustomContextMenuBehavior/AllOrders.cs new file mode 100644 index 00000000..7ad2c89c --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/AllOrders.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.ObjectModel; + +namespace CustomContextMenuBehavior +{ + public class AllOrders : Collection + { + public AllOrders() + { + this.Add(new Order { Date = new DateTime(2010, 6, 1), Product = "Printer stand", Quantity = 11, Net = 200.26, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 1), Product = "Glare filter", Quantity = 6, Net = 77.82, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 1), Product = "Mouse pad", Quantity = 15, Net = 100.95, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 1), Product = "Glare filter", Quantity = 11, Net = 149.71, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 2), Product = "Mouse pad", Quantity = 22, Net = 155.40, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 2), Product = "Mouse pad", Quantity = 3, Net = 20.19, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 2), Product = "Copy holder", Quantity = 5, Net = 33.65, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 2), Product = "Printer stand", Quantity = 22, Net = 239.36, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 2), Product = "Glare filter", Quantity = 10, Net = 129.70, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Mouse pad", Quantity = 22, Net = 155.40, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Printer stand", Quantity = 8, Net = 82.96, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Printer stand", Quantity = 22, Net = 239.40, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Copy holder", Quantity = 55, Net = 388.50, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Mouse pad", Quantity = 25, Net = 168.25, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Glare filter", Quantity = 22, Net = 299.42, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 6), Product = "Mouse pad", Quantity = 33, Net = 256.41, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 6), Product = "Printer stand", Quantity = 11, Net = 119.70, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 6), Product = "Glare filter", Quantity = 22, Net = 329.34, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 6), Product = "Copy holder", Quantity = 20, Net = 134.60, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 24), Product = "Printer stand", Quantity = 99, Net = 1185.03, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 24), Product = "Printer stand", Quantity = 55, Net = 658.35, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 5), Product = "Printer stand", Quantity = 11, Net = 131.67, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 8), Product = "Printer stand", Quantity = 25, Net = 299.25, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 9), Product = "Printer stand", Quantity = 22, Net = 263.34, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 12), Product = "Printer stand", Quantity = 11, Net = 131.67, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 13), Product = "Printer stand", Quantity = 22, Net = 263.34, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 14), Product = "Printer stand", Quantity = 30, Net = 311.10, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 15), Product = "Printer stand", Quantity = 15, Net = 155.55, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 16), Product = "Printer stand", Quantity = 20, Net = 207.40, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 17), Product = "Printer stand", Quantity = 74, Net = 767.38, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 7), Product = "Printer stand", Quantity = 102, Net = 1057.74, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 8), Product = "Glare filter", Quantity = 22, Net = 329.34, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 9), Product = "Glare filter", Quantity = 11, Net = 164.67, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 12), Product = "Glare filter", Quantity = 33, Net = 494.01, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 13), Product = "Glare filter", Quantity = 33, Net = 494.01, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 14), Product = "Glare filter", Quantity = 25, Net = 374.25, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 15), Product = "Glare filter", Quantity = 30, Net = 449.10, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 16), Product = "Glare filter", Quantity = 30, Net = 449.10, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 16), Product = "Glare filter", Quantity = 25, Net = 374.25, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 17), Product = "Glare filter", Quantity = 15, Net = 224.55, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 20), Product = "Glare filter", Quantity = 99, Net = 1482.03, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 21), Product = "Glare filter", Quantity = 132, Net = 1976.04, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 22), Product = "Glare filter", Quantity = 15, Net = 194.55, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 23), Product = "Glare filter", Quantity = 69, Net = 894.93, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 24), Product = "Glare filter", Quantity = 120, Net = 1556.40, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 7), Product = "Mouse pad", Quantity = 55, Net = 427.35, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 8), Product = "Mouse pad", Quantity = 44, Net = 341.88, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 9), Product = "Mouse pad", Quantity = 55, Net = 427.35, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 12), Product = "Mouse pad", Quantity = 66, Net = 512.82, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 13), Product = "Mouse pad", Quantity = 50, Net = 336.50, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 14), Product = "Mouse pad", Quantity = 45, Net = 302.85, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 15), Product = "Mouse pad", Quantity = 75, Net = 504.75, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 16), Product = "Mouse pad", Quantity = 50, Net = 336.50, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 25), Product = "Mouse pad", Quantity = 77, Net = 598.29, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 26), Product = "Mouse pad", Quantity = 165, Net = 1282.05, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 17), Product = "Mouse pad", Quantity = 187, Net = 1452.99, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 18), Product = "Mouse pad", Quantity = 68, Net = 457.64, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 19), Product = "Mouse pad", Quantity = 122, Net = 821.06, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 20), Product = "Mouse pad", Quantity = 175, Net = 1177.75, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 7), Product = "Copy holder", Quantity = 25, Net = 168.25, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 8), Product = "Copy holder", Quantity = 30, Net = 201.90, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 9), Product = "Copy holder", Quantity = 15, Net = 100.95, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 12), Product = "Copy holder", Quantity = 20, Net = 134.60, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 13), Product = "Copy holder", Quantity = 11, Net = 85.47, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 14), Product = "Copy holder", Quantity = 22, Net = 170.94, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 15), Product = "Copy holder", Quantity = 22, Net = 170.94, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 16), Product = "Copy holder", Quantity = 33, Net = 256.41, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 21), Product = "Copy holder", Quantity = 22, Net = 170.94, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 22), Product = "Copy holder", Quantity = 66, Net = 512.82, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 23), Product = "Copy holder", Quantity = 121, Net = 940.17, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 6, 24), Product = "Copy holder", Quantity = 62, Net = 417.26, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 6, 25), Product = "Copy holder", Quantity = 65, Net = 437.45, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 6, 26), Product = "Copy holder", Quantity = 21, Net = 141.33, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 1), Product = "Printer stand", Quantity = 88, Net = 1053.36, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 2), Product = "Printer stand", Quantity = 44, Net = 526.68, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 3), Product = "Printer stand", Quantity = 77, Net = 921.69, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 4), Product = "Printer stand", Quantity = 102, Net = 1057.74, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 5), Product = "Printer stand", Quantity = 60, Net = 622.20, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 6), Product = "Printer stand", Quantity = 80, Net = 829.60, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 7), Product = "Glare filter", Quantity = 110, Net = 1646.70, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 8), Product = "Glare filter", Quantity = 77, Net = 1152.69, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 9), Product = "Glare filter", Quantity = 77, Net = 1152.69, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 10), Product = "Glare filter", Quantity = 124, Net = 1608.28, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 11), Product = "Glare filter", Quantity = 65, Net = 843.05, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 12), Product = "Glare filter", Quantity = 130, Net = 1686.10, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 13), Product = "Mouse pad", Quantity = 275, Net = 2136.75, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 14), Product = "Mouse pad", Quantity = 121, Net = 940.17, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 15), Product = "Mouse pad", Quantity = 176, Net = 1367.52, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 16), Product = "Mouse pad", Quantity = 274, Net = 1844.02, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 17), Product = "Mouse pad", Quantity = 141, Net = 948.93, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 18), Product = "Mouse pad", Quantity = 166, Net = 1117.18, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 19), Product = "Copy holder", Quantity = 99, Net = 769.23, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 20), Product = "Copy holder", Quantity = 55, Net = 427.35, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 21), Product = "Copy holder", Quantity = 132, Net = 1025.64, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 7, 22), Product = "Copy holder", Quantity = 75, Net = 504.75, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 7, 23), Product = "Copy holder", Quantity = 60, Net = 403.80, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 7, 24), Product = "Copy holder", Quantity = 88, Net = 592.24, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 1), Product = "Printer stand", Quantity = 66, Net = 790.02, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 2), Product = "Printer stand", Quantity = 44, Net = 526.68, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 3), Product = "Printer stand", Quantity = 33, Net = 395.01, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 4), Product = "Printer stand", Quantity = 90, Net = 933.30, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 5), Product = "Printer stand", Quantity = 20, Net = 207.40, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 6), Product = "Printer stand", Quantity = 80, Net = 829.60, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 7), Product = "Glare filter", Quantity = 88, Net = 1317.36, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 8), Product = "Glare filter", Quantity = 44, Net = 658.68, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 9), Product = "Glare filter", Quantity = 33, Net = 494.01, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 10), Product = "Glare filter", Quantity = 87, Net = 1128.39, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 11), Product = "Glare filter", Quantity = 48, Net = 622.56, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 12), Product = "Glare filter", Quantity = 95, Net = 1232.15, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 13), Product = "Mouse pad", Quantity = 187, Net = 1452.99, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 14), Product = "Mouse pad", Quantity = 99, Net = 769.23, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 15), Product = "Mouse pad", Quantity = 121, Net = 940.17, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 16), Product = "Mouse pad", Quantity = 198, Net = 1332.54, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 17), Product = "Mouse pad", Quantity = 104, Net = 699.92, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 18), Product = "Mouse pad", Quantity = 144, Net = 969.12, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 19), Product = "Copy holder", Quantity = 77, Net = 598.29, Promotion = "1 Free with 10", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 20), Product = "Copy holder", Quantity = 33, Net = 256.41, Promotion = "1 Free with 10", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 21), Product = "Copy holder", Quantity = 44, Net = 341.88, Promotion = "1 Free with 10", Advertisement = "Newspaper" }); + this.Add(new Order { Date = new DateTime(2010, 8, 22), Product = "Copy holder", Quantity = 57, Net = 383.61, Promotion = "Extra Discount", Advertisement = "Magazine" }); + this.Add(new Order { Date = new DateTime(2010, 8, 23), Product = "Copy holder", Quantity = 38, Net = 255.74, Promotion = "Extra Discount", Advertisement = "Direct mail" }); + this.Add(new Order { Date = new DateTime(2010, 8, 24), Product = "Copy holder", Quantity = 66, Net = 444.18, Promotion = "Extra Discount", Advertisement = "Newspaper" }); + + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/App.config b/PivotGrid/CustomContextMenuBehavior/App.config new file mode 100644 index 00000000..8e156463 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/App.xaml b/PivotGrid/CustomContextMenuBehavior/App.xaml new file mode 100644 index 00000000..eb4c423d --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/App.xaml.cs b/PivotGrid/CustomContextMenuBehavior/App.xaml.cs new file mode 100644 index 00000000..dad76878 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace CustomContextMenuBehavior +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/App_SL.xaml b/PivotGrid/CustomContextMenuBehavior/App_SL.xaml new file mode 100644 index 00000000..98df35bc --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/App_SL.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/App_SL.xaml.cs b/PivotGrid/CustomContextMenuBehavior/App_SL.xaml.cs new file mode 100644 index 00000000..d6346939 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/App_SL.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace CustomContextMenuBehavior +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/CellTemplateSelector.cs b/PivotGrid/CustomContextMenuBehavior/CellTemplateSelector.cs new file mode 100644 index 00000000..1db470bd --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/CellTemplateSelector.cs @@ -0,0 +1,40 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using Telerik.Pivot.Core; +using Telerik.Windows.Controls; + +namespace CustomContextMenuBehavior +{ + public class CellTemplateSelector : DataTemplateSelector + { + public DataTemplate LowerValueTemplate { get; set; } + public DataTemplate HigherValueTemplate { get; set; } + public double LimitValue { get; set; } + public string PropertyName { get; set; } + + public override DataTemplate SelectTemplate(object item, DependencyObject container) + { + var cellAggregate = item as CellAggregateValue; + + if (cellAggregate != null) + { + var description = cellAggregate.Description as PropertyAggregateDescription; + + if (description.PropertyName == this.PropertyName && cellAggregate.RowGroup.Type == GroupType.BottomLevel && cellAggregate.ColumnGroup.Type == GroupType.BottomLevel) + { + if (Convert.ToDouble(cellAggregate.Value) >= this.LimitValue) + { + return this.HigherValueTemplate; + } + else + { + return this.LowerValueTemplate; + } + } + } + + return base.SelectTemplate(item, container); + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml b/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml new file mode 100644 index 00000000..25c38391 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml.cs b/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml.cs new file mode 100644 index 00000000..9127153c --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/CellTemplateSettingsWindow.xaml.cs @@ -0,0 +1,36 @@ +using System.Windows; +using Telerik.Windows.Controls; + +namespace CustomContextMenuBehavior +{ + /// + /// Interaction logic for CellTemplateSettingsWindow.xaml + /// + public partial class CellTemplateSettingsWindow : RadWindow + { + private bool dialogResult; + + public CellTemplateSettingsWindow() + { + InitializeComponent(); + } + + protected override void OnClosed(WindowClosedEventArgs args) + { + var newArgs = new WindowClosedEventArgs { DialogResult = this.dialogResult, PromptResult = this.Numeric.Value.ToString() }; + base.OnClosed(newArgs); + } + + private void OK_Click(object sender, RoutedEventArgs e) + { + this.dialogResult = true; + this.Close(); + } + + private void Cancel_Click(object sender, RoutedEventArgs e) + { + this.dialogResult = false; + this.Close(); + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_SL.csproj b/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_SL.csproj new file mode 100644 index 00000000..664204bf --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_SL.csproj @@ -0,0 +1,167 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {3971312C-623A-49D8-AF47-4073BA32507E} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + CustomContextMenuBehavior + CustomContextMenuBehavior + Silverlight + v5.0 + $(TargetFrameworkVersion) + true + + + true + true + CustomContextMenuBehavior.xap + Properties\AppManifest.xml + CustomContextMenuBehavior.App + CustomContextMenuBehaviorTestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + + + + + + v3.5 + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + $(TargetFrameworkDirectory)System.Core.dll + + + + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Pivot.Core.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Input.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Navigation.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Pivot.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.PivotFieldList.dll + + + + + + App_SL.xaml + + + + CellTemplateSettingsWindow.xaml + + + Example.xaml + + + MainPage.xaml + + + + + + StepSettingsWindow.xaml + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_WPF.csproj b/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_WPF.csproj new file mode 100644 index 00000000..c9e51dd7 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/CustomContextMenuBehavior_WPF.csproj @@ -0,0 +1,168 @@ + + + + + Debug + AnyCPU + {08485209-7167-4FC5-AA2B-1B5826D7745C} + WinExe + Properties + CustomContextMenuBehavior + CustomContextMenuBehavior + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + 4.0 + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Pivot.Core.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Navigation.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Pivot.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.PivotFieldList.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll + + + + + + + + MSBuild:Compile + Designer + + + StepSettingsWindow.xaml + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + + App.xaml + Code + + + + CellTemplateSettingsWindow.xaml + + + + Example.xaml + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/Example.xaml b/PivotGrid/CustomContextMenuBehavior/Example.xaml new file mode 100644 index 00000000..35d6c857 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Example.xaml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/Example.xaml.cs b/PivotGrid/CustomContextMenuBehavior/Example.xaml.cs new file mode 100644 index 00000000..87b7a485 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Example.xaml.cs @@ -0,0 +1,33 @@ +using System.Windows.Controls; +using Telerik.Windows.Controls.FieldList; + +namespace CustomContextMenuBehavior +{ + /// + /// Interaction logic for Example.xaml + /// + public partial class Example : UserControl + { + public string ReadMe { get; set; } + + public Example() + { + InitializeComponent(); + this.ReadMe = GetText(); + this.DataContext = this; + + var customContextMenuBehavior = new MyCustomContextMenuBehavior(); + customContextMenuBehavior.Pivot = this.radPivotGrid; + FieldListContextMenuBehavior.SetBehavior(this.radPivotFieldList, customContextMenuBehavior); + } + + private string GetText() + { + return @"This example demonstrates how to implement a custom ContextMenuBehavior, which will allow you to modify the ContextMenus in RadPivotFieldList. + The following scenarios are covered in the example: + - The Label Filter of the PropertyGroupDescription items is removed + - There is option added to change the step of the DoubleGroupDescription items + - There is option added to color the cells of the AggregateDescription items depending on some condition"; + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/MainPage.xaml b/PivotGrid/CustomContextMenuBehavior/MainPage.xaml new file mode 100644 index 00000000..c52d597e --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/MainPage.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/MainPage.xaml.cs b/PivotGrid/CustomContextMenuBehavior/MainPage.xaml.cs new file mode 100644 index 00000000..5d75ba49 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/MainPage.xaml.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace CustomContextMenuBehavior +{ + public partial class MainPage : UserControl + { + public MainPage() + { + InitializeComponent(); + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml b/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml new file mode 100644 index 00000000..697d8b04 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml @@ -0,0 +1,10 @@ + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml.cs b/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml.cs new file mode 100644 index 00000000..be16db0a --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace CustomContextMenuBehavior +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs b/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs new file mode 100644 index 00000000..b2a2a36b --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs @@ -0,0 +1,142 @@ +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using Telerik.Pivot.Core; +using Telerik.Windows.Controls; +using Telerik.Windows.Controls.FieldList; + +namespace CustomContextMenuBehavior +{ + public class MyCustomContextMenuBehavior : FieldListContextMenuBehavior + { + private bool isCellTemplateSelectorSet; + + public MyCustomContextMenuBehavior() + : base() + { + this.RemoveColorsCommand = new DelegateCommand(OnRemoveColoringExecute, canExecute => this.isCellTemplateSelectorSet); + } + + public RadPivotGrid Pivot { get; set; } + + public ICommand RemoveColorsCommand { get; set; } + + protected override RadContextMenu CreateContextMenu(object dataContext) + { + var contextMenu = base.CreateContextMenu(dataContext); + + if (dataContext is Telerik.Pivot.Core.PropertyGroupDescription) + { + var itemToRemove = contextMenu.Items.Cast().FirstOrDefault(i => (i as RadMenuItem).Header != null && (i as RadMenuItem).Header.Equals("Label Filter")); + + if (itemToRemove != null) + { + contextMenu.Items.Remove(itemToRemove); + } + } + + if (dataContext is DoubleGroupDescription) + { + contextMenu.Items.Add(new RadMenuSeparatorItem()); + contextMenu.Items.Add(new RadMenuItem { Header = "Change the Step", Command = new DelegateCommand(OnChangeStepExecute), CommandParameter = dataContext }); + } + + if (dataContext is AggregateDescriptionBase) + { + contextMenu.Items.Add(new RadMenuSeparatorItem()); + contextMenu.Items.Add(new RadMenuItem { Header = "Color Cells", Command = new DelegateCommand(OnColorCellsExecute), CommandParameter = dataContext }); + contextMenu.Items.Add(new RadMenuItem { Header = "Remove Coloring", Command = this.RemoveColorsCommand }); + } + + return contextMenu; + } + + private void OnColorCellsExecute(object obj) + { + var cellTemplateSettingsWindow = new CellTemplateSettingsWindow(); + + cellTemplateSettingsWindow.Closed += (s, e) => + { + if (e.DialogResult == true) + { + var selector = new CellTemplateSelector(); + selector.LowerValueTemplate = this.CreateDataTemplate(cellTemplateSettingsWindow.LowerValueColorPicker.SelectedColor); + selector.HigherValueTemplate = this.CreateDataTemplate(cellTemplateSettingsWindow.HigherValueColorPicker.SelectedColor); + + var groupDesc = obj as PropertyAggregateDescription; + selector.PropertyName = groupDesc.PropertyName; + selector.LimitValue = double.Parse(e.PromptResult); + + this.Pivot.CellTemplateSelector = null; + this.Pivot.CellTemplateSelector = selector; + this.isCellTemplateSelectorSet = true; + (this.RemoveColorsCommand as DelegateCommand).InvalidateCanExecute(); + } + }; + + cellTemplateSettingsWindow.ShowDialog(); + } + + private void OnRemoveColoringExecute(object obj) + { + this.Pivot.CellTemplateSelector = null; + this.isCellTemplateSelectorSet = false; + (this.RemoveColorsCommand as DelegateCommand).InvalidateCanExecute(); + } + + private void OnChangeStepExecute(object obj) + { + var groupDesc = obj as DoubleGroupDescription; + var settingsWindow = new StepSettingsWindow(groupDesc.Step); + + settingsWindow.Closed += (s, e) => + { + if (e.DialogResult == true) + { + groupDesc.Step = int.Parse(e.PromptResult); + + if (!this.Pivot.DataProvider.DeferUpdates) + { + this.Pivot.DataProvider.Refresh(); + } + } + }; + + settingsWindow.ShowDialog(); + } + + private DataTemplate CreateDataTemplate(Color color) + { +#if SILVERLIGHT + return (DataTemplate)XamlReader.Load( + @" + + + + " + ); +#else + FrameworkElementFactory border = new FrameworkElementFactory(typeof(Border)); + border.SetValue(Border.BorderThicknessProperty, new Thickness(1, 1, 0, 0)); + border.SetValue(Border.BorderBrushProperty, Brushes.LightGray); + border.SetValue(Border.BackgroundProperty, new SolidColorBrush(color)); + DataTemplate dataTemplate = new DataTemplate(); + dataTemplate.VisualTree = border; + FrameworkElementFactory textBlock = new FrameworkElementFactory(typeof(TextBlock)); + textBlock.SetBinding(TextBlock.TextProperty, new Binding("Data")); + textBlock.SetValue(TextBlock.MarginProperty, new Thickness(2)); + textBlock.SetValue(TextBlock.VerticalAlignmentProperty, VerticalAlignment.Center); + textBlock.SetValue(TextBlock.HorizontalAlignmentProperty, HorizontalAlignment.Right); + border.AppendChild(textBlock); + dataTemplate.Seal(); + + return dataTemplate; +#endif + } + } +} + diff --git a/PivotGrid/CustomContextMenuBehavior/Order.cs b/PivotGrid/CustomContextMenuBehavior/Order.cs new file mode 100644 index 00000000..ca4b91d7 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Order.cs @@ -0,0 +1,123 @@ +using System; +using System.ComponentModel; + +namespace CustomContextMenuBehavior +{ + public class Order : INotifyPropertyChanged + { + private DateTime date; + private string product; + private int quantity; + private double net; + private string promotion; + private string advertisement; + + public DateTime Date + { + get + { + return this.date; + } + set + { + if (this.date != value) + { + this.date = value; + OnPropertyChanged("Date"); + } + } + } + + public string Product + { + get + { + return this.product; + } + set + { + if (this.product != value) + { + this.product = value; + OnPropertyChanged("Product"); + } + } + } + + public int Quantity + { + get + { + return this.quantity; + } + set + { + if (this.quantity != value) + { + this.quantity = value; + OnPropertyChanged("Quantity"); + } + } + } + + public double Net + { + get + { + return this.net; + } + set + { + if (this.net != value) + { + this.net = value; + OnPropertyChanged("Net"); + } + } + } + + public string Promotion + { + get + { + return this.promotion; + } + set + { + if (this.promotion != value) + { + this.promotion = value; + OnPropertyChanged("Promotion"); + } + } + } + + public string Advertisement + { + get + { + return this.advertisement; + } + set + { + if (this.advertisement != value) + { + this.advertisement = value; + OnPropertyChanged("Advertisement"); + } + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged(string name) + { + PropertyChangedEventHandler handler = PropertyChanged; + + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(name)); + } + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/AppManifest.xml b/PivotGrid/CustomContextMenuBehavior/Properties/AppManifest.xml new file mode 100644 index 00000000..6712a117 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/AppManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/AssemblyInfo.cs b/PivotGrid/CustomContextMenuBehavior/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..67fe9cca --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomContextMenuBehavior")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomContextMenuBehavior")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3971312c-623a-49d8-af47-4073ba32507e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/Resources.Designer.cs b/PivotGrid/CustomContextMenuBehavior/Properties/Resources.Designer.cs new file mode 100644 index 00000000..658c8087 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18408 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomContextMenuBehavior.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomContextMenuBehavior.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/Resources.resx b/PivotGrid/CustomContextMenuBehavior/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/Settings.Designer.cs b/PivotGrid/CustomContextMenuBehavior/Properties/Settings.Designer.cs new file mode 100644 index 00000000..5229216d --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18408 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomContextMenuBehavior.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/PivotGrid/CustomContextMenuBehavior/Properties/Settings.settings b/PivotGrid/CustomContextMenuBehavior/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/Readme.txt b/PivotGrid/CustomContextMenuBehavior/Readme.txt new file mode 100644 index 00000000..d3fce606 --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/Readme.txt @@ -0,0 +1,6 @@ +#Custom ContextMenuBehavior# +This example demonstrates how to implement a custom ContextMenuBehavior, which will allow you to modify the ContextMenus in RadPivotFieldList. + The following scenarios are covered in the example: + - The Label Filter of the PropertyGroupDescription items is removed + - There is option added to change the step of the DoubleGroupDescription items + - There is option added to color the cells of the AggregateDescription items depending on some condition \ No newline at end of file diff --git a/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml b/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml new file mode 100644 index 00000000..22d4d0fb --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml.cs b/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml.cs new file mode 100644 index 00000000..0e598f4d --- /dev/null +++ b/PivotGrid/CustomContextMenuBehavior/StepSettingsWindow.xaml.cs @@ -0,0 +1,35 @@ +using System.Windows; +using Telerik.Windows.Controls; + +namespace CustomContextMenuBehavior +{ + public partial class StepSettingsWindow : RadWindow + { + private bool dialogResult; + internal double Step { get; set; } + + public StepSettingsWindow(double step) + { + InitializeComponent(); + this.Numeric.Value = step; + } + + protected override void OnClosed(WindowClosedEventArgs args) + { + var newArgs = new WindowClosedEventArgs { DialogResult = this.dialogResult, PromptResult = this.Numeric.Value.ToString() }; + base.OnClosed(newArgs); + } + + private void OK_Click(object sender, RoutedEventArgs e) + { + this.dialogResult = true; + this.Close(); + } + + private void Cancel_Click(object sender, RoutedEventArgs e) + { + this.dialogResult = false; + this.Close(); + } + } +} diff --git a/PivotGrid/PivotGrid_SL.sln b/PivotGrid/PivotGrid_SL.sln index 550515cf..6ded471b 100644 --- a/PivotGrid/PivotGrid_SL.sln +++ b/PivotGrid/PivotGrid_SL.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalDataSourcePersistence_SL", "Persistence\LocalDataSourceProvider\LocalDataSourcePersistence_SL.csproj", "{1D330BF9-D365-4CC0-9A10-98874BB98404}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlaPersistence_SL", "Persistence\XmlaPersistence\XmlaPersistence_SL.csproj", "{0A3C6B7E-63FA-443C-B530-97606E31878A}" @@ -29,6 +31,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalDataSourceCalculatedFi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalDataSourceCalculatedItems_SL", "CalculatedItems\LocalDataSourceCalculatedItems\LocalDataSourceCalculatedItems_SL.csproj", "{6422C1C3-28CA-4560-85E8-DE77B5A2301C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomContextMenuBehavior_SL", "CustomContextMenuBehavior\CustomContextMenuBehavior_SL.csproj", "{3971312C-623A-49D8-AF47-4073BA32507E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -92,6 +96,10 @@ Global {6422C1C3-28CA-4560-85E8-DE77B5A2301C}.Debug|Any CPU.Build.0 = Debug|Any CPU {6422C1C3-28CA-4560-85E8-DE77B5A2301C}.Release|Any CPU.ActiveCfg = Release|Any CPU {6422C1C3-28CA-4560-85E8-DE77B5A2301C}.Release|Any CPU.Build.0 = Release|Any CPU + {3971312C-623A-49D8-AF47-4073BA32507E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3971312C-623A-49D8-AF47-4073BA32507E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3971312C-623A-49D8-AF47-4073BA32507E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3971312C-623A-49D8-AF47-4073BA32507E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PivotGrid/PivotGrid_WPF.sln b/PivotGrid/PivotGrid_WPF.sln index 77ec2f3a..27807a9d 100644 --- a/PivotGrid/PivotGrid_WPF.sln +++ b/PivotGrid/PivotGrid_WPF.sln @@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueryableCalculatedFields_W EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueryableCalculatedItems_WPF", "CalculatedItems\QueryableCalculatedItems\QueryableCalculatedItems_WPF.csproj", "{F2FFB684-83F5-4591-9082-920DC64FEA0B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomContextMenuBehavior_WPF", "CustomContextMenuBehavior\CustomContextMenuBehavior_WPF.csproj", "{08485209-7167-4FC5-AA2B-1B5826D7745C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -118,6 +120,10 @@ Global {F2FFB684-83F5-4591-9082-920DC64FEA0B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2FFB684-83F5-4591-9082-920DC64FEA0B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F2FFB684-83F5-4591-9082-920DC64FEA0B}.Release|Any CPU.Build.0 = Release|Any CPU + {08485209-7167-4FC5-AA2B-1B5826D7745C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08485209-7167-4FC5-AA2B-1B5826D7745C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08485209-7167-4FC5-AA2B-1B5826D7745C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08485209-7167-4FC5-AA2B-1B5826D7745C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RichTextBox/RichTextBox_SL.sln b/RichTextBox/RichTextBox_SL.sln index 2074356a..9251a688 100644 --- a/RichTextBox/RichTextBox_SL.sln +++ b/RichTextBox/RichTextBox_SL.sln @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeRibbonUIDataContext_S EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBinding_SL", "DataBinding\DataBinding_SL.csproj", "{CF815898-F41C-4AEC-BE07-C6124A0B867A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimulateWatermark_SL", "SimulateWatermark\SimulateWatermark_SL.csproj", "{BE866F9D-1763-460D-B3F8-56652B9308BD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -110,6 +112,10 @@ Global {CF815898-F41C-4AEC-BE07-C6124A0B867A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF815898-F41C-4AEC-BE07-C6124A0B867A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF815898-F41C-4AEC-BE07-C6124A0B867A}.Release|Any CPU.Build.0 = Release|Any CPU + {BE866F9D-1763-460D-B3F8-56652B9308BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE866F9D-1763-460D-B3F8-56652B9308BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE866F9D-1763-460D-B3F8-56652B9308BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE866F9D-1763-460D-B3F8-56652B9308BD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RichTextBox/RichTextBox_WPF.sln b/RichTextBox/RichTextBox_WPF.sln index b76cace2..555e6453 100644 --- a/RichTextBox/RichTextBox_WPF.sln +++ b/RichTextBox/RichTextBox_WPF.sln @@ -41,6 +41,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreadSafeDocumentConversio EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBinding_WPF", "DataBinding\DataBinding_WPF.csproj", "{F3A661C5-6BFC-497A-BFA2-ECA2ECDEAB1C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimulateWatermark_WPF", "SimulateWatermark\SimulateWatermark_WPF.csproj", "{0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -252,6 +254,16 @@ Global {F3A661C5-6BFC-497A-BFA2-ECA2ECDEAB1C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {F3A661C5-6BFC-497A-BFA2-ECA2ECDEAB1C}.Release|Mixed Platforms.Build.0 = Release|Any CPU {F3A661C5-6BFC-497A-BFA2-ECA2ECDEAB1C}.Release|x86.ActiveCfg = Release|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Release|Any CPU.Build.0 = Release|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0A2CE792-9EA5-4CC8-930D-2A7B87315FBA}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RichTextBox/SimulateWatermark/App.xaml b/RichTextBox/SimulateWatermark/App.xaml new file mode 100644 index 00000000..578b7cda --- /dev/null +++ b/RichTextBox/SimulateWatermark/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/RichTextBox/SimulateWatermark/App.xaml.cs b/RichTextBox/SimulateWatermark/App.xaml.cs new file mode 100644 index 00000000..ecf356da --- /dev/null +++ b/RichTextBox/SimulateWatermark/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace SimulateWatermark +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/RichTextBox/SimulateWatermark/App_SL.xaml b/RichTextBox/SimulateWatermark/App_SL.xaml new file mode 100644 index 00000000..5af895ee --- /dev/null +++ b/RichTextBox/SimulateWatermark/App_SL.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/RichTextBox/SimulateWatermark/App_SL.xaml.cs b/RichTextBox/SimulateWatermark/App_SL.xaml.cs new file mode 100644 index 00000000..b18a1853 --- /dev/null +++ b/RichTextBox/SimulateWatermark/App_SL.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace SimulateWatermark +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/RichTextBox/SimulateWatermark/MainPage.xaml b/RichTextBox/SimulateWatermark/MainPage.xaml new file mode 100644 index 00000000..970d7392 --- /dev/null +++ b/RichTextBox/SimulateWatermark/MainPage.xaml @@ -0,0 +1,14 @@ + + + +