Exemple #1
0
 public AlignGroupSummariesByColumnsViewModel()
 {
     SalesByYearReport  = SalesByYearData.GetSalesByYearData(false);
     SalesByMonthReport = SalesByYearData.GetSalesByYearData(true);
     UpdateActualSalesReport();
     allowCascadeUpdate = true;
 }
 void AssignDataSource()
 {
     grid.ItemsSource                         = SalesByYearData.GetSalesByYearData();
     grid.Columns["Date"].Visible             = false;
     grid.Columns["Date"].ShowInColumnChooser = false;
     foreach (GridColumn column in view.VisibleColumns)
     {
         grid.TotalSummary.Add(new GridSummaryItem()
         {
             FieldName = column.FieldName, SummaryType = DevExpress.Data.SummaryItemType.Custom, DisplayFormat = "${0:N}"
         });
         column.EditSettings = new SpinEditSettings()
         {
             MaskType = MaskType.Numeric, MaskUseAsDisplayFormat = true, Mask = "c", MaskCulture = new CultureInfo("en-US")
         };
     }
 }
 PropertyDescriptorCollection CreateColumnCollection(List <string> columnNames)
 {
     CellSelectionPropertyDescriptor[] pds = new CellSelectionPropertyDescriptor[columnNames.Count];
     for (int i = 0; i < columnNames.Count; i++)
     {
         pds[i] = new CellSelectionPropertyDescriptor(this, columnNames[i], SalesByYearData.GetColumnType(columnNames[i]));
     }
     return(new PropertyDescriptorCollection(pds));
 }