public GridViewSettings CreateAirGridViewSettings() { GridViewSettings settings = new GridViewSettings(); settings.Name = "All"; settings.Columns.Add("Master"); settings.Columns.Add("FileNo"); settings.Columns.Add("House"); settings.Columns.Add("Shipper"); settings.Columns.Add("Consignee"); settings.Columns.Add("Agent"); settings.Columns.Add("Carrier"); settings.Columns.Add("Origin"); settings.Columns.Add("Destination"); settings.Columns.Add("Quantity").PropertiesEdit.DisplayFormatString = "n"; settings.Columns.Add("Date").PropertiesEdit.DisplayFormatString = "d"; settings.Columns.Add(column => { column.FieldName = "Gros_Wt"; column.SetHeaderCaptionTemplateContent("Gros WT."); }); settings.Columns.Add("ChargeableWeight"); settings.Columns.Add(column => { column.FieldName = "ChargeableWeight"; column.SetHeaderCaptionTemplateContent("Chargeable WT."); }); settings.Columns.Add(column => { column.FieldName = "Freight_Charge"; column.SetHeaderCaptionTemplateContent("Freight Charge"); column.PropertiesEdit.DisplayFormatString = "c"; }); settings.Columns.Add(column => { column.FieldName = "Other_Charge"; column.SetHeaderCaptionTemplateContent("Other Charge"); column.PropertiesEdit.DisplayFormatString = "c"; }); settings.Settings.ShowFooter = true; settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Gros_Wt"); settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "ChargeableWeight"); settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Freight_Charge"); settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Other_Charge"); settings.DataBound = (sender, e) => { MVCxGridView grid = (MVCxGridView)sender; string KeyFieldName = (string)Session["KeyFieldName"]; grid.GroupBy(grid.Columns[KeyFieldName]); }; return(settings); }
public override void ConfigureExecution(GridViewSettings settings, HtmlHelper html, ViewContext viewContext) { base.ConfigureExecution(settings, html, viewContext); settings.SettingsBehavior.AllowSelectSingleRowOnly = true; settings.Settings.ShowGroupFooter = DevExpress.Web.GridViewGroupFooterMode.VisibleAlways; settings.SetGroupFooterRowTemplateContent(c => { var isPlanMonitoring = (bool)DataBinder.Eval(c.DataItem, "IsPlantMonitoring"); var subGroupText = (string)DataBinder.Eval(c.DataItem, "SubGroup"); var content = string.Empty; if (isPlanMonitoring) { var groupId = (int)DataBinder.Eval(c.DataItem, "GroupId"); html.RenderPartial("BarrierAuthorityRenderAssetsPartial", RigChecklist.Assets.ToGroupAssetModels(groupId, GetClient <OapChecklistAssetDataManagementClient>())); } }); settings.HtmlRowCreated = (sender, e) => { var isPlantMonitoringRow = (bool)(e.GetValue("IsPlantMonitoring") ?? false); if (e.RowType == DevExpress.Web.GridViewRowType.GroupFooter) { e.Row.Visible = isPlantMonitoringRow; } }; settings.BeforeGetCallbackResult = (sender, e) => { MVCxGridView grid = (MVCxGridView)sender; grid.ClearSort(); var i = grid.GroupCount; grid.GroupBy(grid.Columns["Group"]); grid.GroupBy(grid.Columns["SubGroup"]); }; }
public GridViewSettings CreatePNLGridViewSettings() { GridViewSettings settings = new GridViewSettings(); settings.Name = "grid"; settings.SettingsPager.PageSize = 30; settings.Columns.Add("Customer_Name", "Customer").GroupIndex = GetGroupIndex("Customer_Name"); settings.Columns.Add("ImportExport", "Import/Export").GroupIndex = GetGroupIndex("ImportExport"); settings.Columns.Add("AirOcean", "Air/Ocean").GroupIndex = GetGroupIndex("AirOcean"); settings.Columns.Add("MBL_NUM", "MAWB/MBOL").GroupIndex = GetGroupIndex("MBL_NUM"); settings.Columns.Add("HBL_NUM", "HAWB/HBOL").GroupIndex = GetGroupIndex("HBL_NUM"); settings.Columns.Add("Date").GroupIndex = GetGroupIndex("Date"); settings.Columns.Add("Description", "Item").GroupIndex = GetGroupIndex("Description"); settings.Columns.Add("ORIGIN", "Origination").GroupIndex = GetGroupIndex("ORIGIN"); settings.Columns.Add("DEST", "Destination").GroupIndex = GetGroupIndex("DEST"); settings.Columns.Add("Revenue"); settings.Columns.Add("Expense"); settings.Columns.Add("Profit"); settings.Settings.ShowFooter = true; settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Revenue"); settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Expense"); settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Profit"); settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Revenue"); settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Expense"); settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Profit"); settings.Settings.ShowGroupPanel = true; settings.DataBound = (sender, e) => { MVCxGridView grid = (MVCxGridView)sender; ArrayList PNLGropuing = GetPNLGrouping(); for (int i = 0; i < PNLGropuing.Count; i++) { grid.GroupBy(grid.Columns[PNLGropuing[i].ToString()]); } grid.ExpandAll(); }; return(settings); }
public GridViewSettings CreateOceanGridViewSettings() { GridViewSettings settings = new GridViewSettings(); settings.Name = "All"; settings.Columns.Add("FileNo", "File#"); settings.Columns.Add("Master", "MBOL#"); settings.Columns.Add("House", "HBOL#"); settings.Columns.Add("Shipper"); settings.Columns.Add("Consignee"); settings.Columns.Add("Agent"); settings.Columns.Add("Carrier"); settings.Columns.Add("Origin"); settings.Columns.Add("Destination"); settings.Columns.Add("Date", "ETD"); settings.Columns.Add("Sale_Rep", "Sales Rep."); settings.Columns.Add("Processed_By", "Processed By"); settings.Columns.Add("Processed_By", "Processed By"); settings.Columns.Add(c => { c.FieldName = "Quantity"; c.Caption = ""; ((MVCxGridViewColumn)c).CellStyle.CssClass = "numeric"; }); settings.Columns.Add(c => { c.FieldName = "Gros_Wt"; c.Caption = "Gros Wt."; ((MVCxGridViewColumn)c).CellStyle.CssClass = "numeric"; }); settings.Columns.Add(c => { c.FieldName = "Measurement"; c.Caption = "Measurement (CBM)"; ((MVCxGridViewColumn)c).CellStyle.CssClass = "numeric"; }); settings.Columns.Add(c => { c.FieldName = "Freight_Charge"; c.Caption = "Freight Charge"; ((MVCxGridViewColumn)c).CellStyle.CssClass = "numeric"; }); settings.Columns.Add(c => { c.FieldName = "Other_Charge"; c.Caption = "Other Charge"; ((MVCxGridViewColumn)c).CellStyle.CssClass = "numeric"; }); settings.DataBound = (sender, e) => { MVCxGridView grid = (MVCxGridView)sender; string KeyFieldName = (string)Session["KeyFieldName"]; grid.GroupBy(grid.Columns[KeyFieldName]); }; return(settings); }
static GridViewSettings CreateStationGridSettings() { EssoEntities DB2 = new EssoEntities(); GridViewSettings settings = new GridViewSettings(); settings.Name = "gvStation"; settings.KeyFieldName = "ID"; settings.CallbackRouteValues = new { Controller = "Station", Action = "GridStationPartial" }; settings.Width = Unit.Percentage(100); settings.InitNewRow += grid_InitNewRow; settings.SettingsEditing.Mode = GridViewEditingMode.EditForm; settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Station", Action = "SaveStation" }; settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Station", Action = "UpdateStation" }; settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Station", Action = "DeleteStation" }; settings.SettingsBehavior.ConfirmDelete = true; settings.SettingsBehavior.AllowGroup = true; settings.SettingsBehavior.AllowSort = true; settings.Settings.VerticalScrollBarMode = ScrollBarMode.Visible; settings.Settings.VerticalScrollableHeight = 500; settings.SettingsPager.PageSize = 20; settings.SettingsPager.Position = PagerPosition.Bottom; //settings.SettingsPager.FirstPageButton.Visible = true; //settings.SettingsPager.LastPageButton.Visible = true; //settings.SettingsPager.PageSizeItemSettings.Visible = true; //settings.SettingsPager.PageSizeItemSettings.Items = new string[] { "10", "20", "50" }; settings.Settings.ShowFilterRow = true; settings.Settings.ShowFilterRowMenu = true; settings.ClientSideEvents.BeginCallback = "OnStationBeginCallback"; //settings.Columns.Add(c => //{ // c.FieldName = "PHOTO"; // c.EditorProperties().BinaryImage(p => // { // p.ImageHeight = 170; // p.ImageWidth = 160; // p.EnableServerResize = true; // p.ImageSizeMode = ImageSizeMode.FitProportional; // p.CallbackRouteValues = new { Action = "BinaryImageColumnPhotoUpdate", Controller = "Station" }; // p.EditingSettings.Enabled = true; // p.EditingSettings.UploadSettings.UploadValidationSettings.MaxFileSize = 4194304; // }); //}); settings.Columns.Add(c => { c.FieldName = "NAME"; c.Caption = "Plant Name"; }); settings.Columns.Add(c => { c.FieldName = "SIZE"; c.Caption = "Size"; c.Width = Unit.Pixel(150); }); //settings.Columns.Add(c => //{ // c.FieldName = "NAME"; // c.Caption = "Group Name"; // c.Visible = false; // c.GroupIndex = 0; // c.EditFormSettings.Visible = DefaultBoolean.False; // c.EditorProperties().ComboBox(p => // { // p.BindList(DB2.StationGroups.Where(x => x.IS_DELETED == false).Select(x => x.NAME).ToList()); // }); //}); settings.Columns.Add(column => { column.FieldName = "GROUP_ID"; column.Caption = "Grup"; column.EditorProperties().ComboBox(p => { p.TextField = "NAME"; p.ValueField = "ID"; p.ValueType = typeof(int); p.DataSource = DB2.StationGroups.Where(x => x.IS_DELETED == false).Select(x => new { x.NAME, x.ID }).ToList(); }); }); //settings.Columns.Add(column => //{ // column.FieldName = "GROUP_ID"; // column.Caption = "Group"; // //column.GroupIndex = 0; // //column.EditFormSettings.Visible = DefaultBoolean.False; // //column.EditorProperties().ComboBox(p => // //{ // // p.BindList(DB2.StationGroups.Where(x => x.IS_DELETED == false).Select(x => x.NAME).ToList()); // //}); //}); settings.Columns.Add(column => { column.FieldName = "USERS"; column.Caption = "Users"; column.EditFormSettings.Visible = DefaultBoolean.False; }); settings.Columns.Add(column => { column.FieldName = "IP_ADDRESS"; column.Caption = "Ip Address"; }); settings.Columns.Add(column => { column.FieldName = "PORT"; column.Caption = "PORT"; }); settings.Columns.Add(column => { column.FieldName = "ALARM_TEMP_ID"; column.Caption = "Alarm Tipi"; column.Visible = false; column.EditFormSettings.Visible = DefaultBoolean.True; }); settings.Columns.Add(column => { column.FieldName = "IS_ACTIVE"; column.Caption = "Active"; column.Width = Unit.Pixel(50); column.ColumnType = MVCxGridViewColumnType.CheckBox; }); settings.Columns.Add(column => { column.FieldName = "IS_LOCKED"; column.Caption = "Locked"; column.Width = Unit.Pixel(50); column.ColumnType = MVCxGridViewColumnType.CheckBox; }); settings.Columns.Add(c => { c.FieldName = "INSTALL_DATE"; c.Caption = "Installation Date"; c.Width = Unit.Pixel(200); }); settings.Columns.Add(c => { c.FieldName = "CREATED_DATE"; c.Caption = "Inserted Date"; c.Width = Unit.Pixel(200); }); //"CREATED_DATE").SortOrder = DevExpress.Data.ColumnSortOrder.Ascending; settings.Columns.Add(column => { column.FieldName = "ADDRESS"; column.Caption = "Address"; column.EditFormSettings.Visible = DefaultBoolean.False; column.Visible = false; }); settings.Columns.Add(column => { column.FieldName = "DESCRIPTION"; column.Caption = "Desription"; column.EditFormSettings.Visible = DefaultBoolean.False; column.Visible = false; }); settings.Columns.Add(column => { column.FieldName = "PLC_INTERFACE"; column.Caption = "PLC INTERFACE"; column.EditFormSettings.Visible = DefaultBoolean.False; column.Visible = false; }); settings.Columns.Add(column => { column.FieldName = "EKK_INTERFACE"; column.Caption = "EKK INTERFACE"; column.EditFormSettings.Visible = DefaultBoolean.False; column.Visible = false; }); settings.Columns.Add(column => { column.FieldName = "IRRADIATION_SCALE"; column.Caption = "Irradiation Scale(%)"; column.EditFormSettings.Visible = DefaultBoolean.False; column.Visible = false; }); settings.BeforeGetCallbackResult = (sender, e) => { MVCxGridView grid = (MVCxGridView)sender; grid.GroupBy(grid.Columns["GROUP_ID"]); }; settings.PreRender = (sender, e) => { ASPxGridView grid = (ASPxGridView)sender; grid.ExpandRow(0); }; return(settings); }