Esempio n. 1
0
        /// <summary>
        /// Grid Settings for better look and feel
        /// </summary>
        private void InitializePivotGrid()
        {
            LocalizationProvider.Provider = new Localizer();

            pivotGridControl1.ItemSource = ProductSalesData.GetSalesData();

            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Product", FieldCaption = "Product", TotalHeader = "Total"
            });

            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Date", TotalHeader = "Total"
            });

            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "Country", FieldCaption = "Country", TotalHeader = "Total"
            });

            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "State", TotalHeader = "Total"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Amount", FieldCaption = "Amount", Format = "C", SummaryType = SummaryType.DoubleTotalSum
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Quantity", FieldCaption = "Quantity", Format = "#,##0"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "UnitPrice", FieldCaption = "UnitPrice"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "TotalPrice", FieldCaption = "TotalPrice"
            });
            pivotGridControl1.GridVisualStyles        = GridVisualStyles.Metro;
            pivotGridControl1.ShowPivotTableFieldList = true;

            //tab key navigation set as false to move the next control
            pivotGridControl1.TableControl.WantTabKey = false;
            pivotGridControl1.TableControl.PivotTableFieldList.WantTabKey = false;
            pivotGridControl1.TableControl.GridColumnList.WantTabKey      = false;
            pivotGridControl1.TableControl.GridFilterList.WantTabKey      = false;
            pivotGridControl1.TableControl.GridRowList.WantTabKey         = false;
            pivotGridControl1.TableControl.GridValueList.WantTabKey       = false;
            pivotGridControl1.PivotSchemaDesigner.TabStop = false;
            pivotGridControl1.TabStop = false;

            LocalizationProvider.Provider = new Localizer();
            Localizer loc = new Localizer();

            LocalizationProvider.Provider = loc;
        }
Esempio n. 2
0
        /// <summary>
        /// Grid Settings for better look and feel
        /// </summary>
        private void InitializePivotGrid()
        {
            LocalizationProvider.Provider = new Localizer();

            pivotGridControl1.ItemSource = ProductSalesData.GetSalesData();

            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Product", FieldCaption = "Product", TotalHeader = "Total"
            });

            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Date", TotalHeader = "Total"
            });

            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "Country", FieldCaption = "Country", TotalHeader = "Total"
            });

            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "State", TotalHeader = "Total"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Amount", FieldCaption = "Amount", Format = "C", SummaryType = SummaryType.DoubleTotalSum
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Quantity", FieldCaption = "Quantity", Format = "#,##0"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "UnitPrice", FieldCaption = "UnitPrice"
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "TotalPrice", FieldCaption = "TotalPrice"
            });
            pivotGridControl1.GridVisualStyles        = GridVisualStyles.Metro;
            pivotGridControl1.ShowPivotTableFieldList = true;

            //tab key navigation set as false to move the next control
            pivotGridControl1.TableControl.WantTabKey = false;
            pivotGridControl1.TableControl.PivotTableFieldList.WantTabKey = false;
            pivotGridControl1.TableControl.GridColumnList.WantTabKey      = false;
            pivotGridControl1.TableControl.GridFilterList.WantTabKey      = false;
            pivotGridControl1.TableControl.GridRowList.WantTabKey         = false;
            pivotGridControl1.TableControl.GridValueList.WantTabKey       = false;
            pivotGridControl1.PivotSchemaDesigner.TabStop = false;
            pivotGridControl1.TabStop = false;

            string targetPath = Application.StartupPath + "\\" + "de-DE";

#if NETCORE
            string sourceFile = Application.StartupPath.Split("\\bin")[0] + "\\de-DE\\Syncfusion.PivotAnalysis.Windows.resources.dll";
#else
            string sourceFile = Path.GetFullPath("..\\..\\de-DE\\Syncfusion.PivotAnalysis.Windows.resources.dll");
#endif
            if (!Directory.Exists(targetPath))
            {
                Directory.CreateDirectory(targetPath);
                File.Copy(sourceFile, targetPath + "\\Syncfusion.PivotAnalysis.Windows.resources.dll");
#if NETCORE
                sourceFile = Application.StartupPath.Split("\\bin")[0] + "\\de-DE\\run.bat";
#else
                sourceFile = Path.GetFullPath("..\\..\\de-DE\\run.bat");
#endif
                File.Copy(sourceFile, targetPath + "\\run.bat");
            }
            LocalizationProvider.Provider = new Localizer();
            Localizer loc = new Localizer();
            LocalizationProvider.Provider = loc;
        }