using DevExpress.Utils;
using DevExpress.Web;
using DevExpress.Web.Mvc;
using DevExpress.Web.Mvc.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Platform.Code.Helpers
{
public enum NAPColumnType
{
Bound = 0,
Integer = 1,
Decimal = 2,
DateTime = 3,
String = 4,
Boolean = 5,
Object = 6,
Date = 7,
}
public enum NAPColumnControlType
{
None = 0,
Textbox = 1,
DropDownList = 2,
Checkbox = 3,
Hyperlink = 4,
Memo = 5,
DateEdit = 6,
IntEdit = 7,
DecimalEdit = 8,
DateTimeEdit = 9,
Button = 10,
DropDownListTextBoxGroup = 11,
TextboxWithButton = 12,
DateWithoutOption = 13,
TextRange = 14
}
public class DevExpressGridHelper
{
private GridViewSettings _Settings;
public string gs_EditField = "";
public string gs_Fields = "";
public string gs_MandatoryField = "";
public DevExpressGridHelper(GridViewSettings settings)
{
this._Settings = settings;
}
public void GridSetting(string as_FunCode)
{
this._Settings.Width = Unit.Percentage(100);
this._Settings.SettingsEditing.Mode = GridViewEditingMode.Batch;
this._Settings.SettingsEditing.BatchEditSettings.EditMode = GridViewBatchEditMode.Cell;
this._Settings.SettingsEditing.BatchEditSettings.StartEditAction = GridViewBatchStartEditAction.Click;
this._Settings.Styles.BatchEditModifiedCell.BackColor = Utils.GetColor.BatchEditModifiedCell;
this._Settings.Styles.BatchEditDeletedRow.BackColor = Utils.GetColor.DeleteColor;
this._Settings.Styles.BatchEditCell.BackColor = Utils.GetColor.BatchEditCellColor;
this._Settings.Styles.SelectedRow.BackColor = Utils.GetColor.BackColor;
this._Settings.Styles.SelectedRow.ForeColor = Utils.GetColor.ForeColor;
this._Settings.ClientSideEvents.CustomizationWindowCloseUp = Utils.GetTranslation("CustomizationWindowCloseUp");
this._Settings.SettingsBehavior.EnableCustomizationWindow = true;
this._Settings.SettingsBehavior.AllowSelectByRowClick = true;
this._Settings.SettingsAdaptivity.AdaptivityMode = GridViewAdaptivityMode.Off;
this._Settings.SettingsAdaptivity.AdaptiveColumnPosition = GridViewAdaptiveColumnPosition.Right;
this._Settings.SettingsAdaptivity.AdaptiveDetailColumnCount = 1;
this._Settings.SettingsAdaptivity.AllowOnlyOneAdaptiveDetailExpanded = false;
this._Settings.SettingsAdaptivity.HideDataCellsAtWindowInnerWidth = 0;
this._Settings.SettingsResizing.ColumnResizeMode = ColumnResizeMode.Control;
this._Settings.SettingsText.EmptyDataRow = Utils.GetTranslation("No data to display");
this._Settings.CellEditorInitialize = (sender, e) =>
{
ASPxEdit editor = (ASPxEdit)e.Editor;
editor.ValidationSettings.Display = Display.Dynamic;
};
this._Settings.CustomJSProperties = (s, e) =>
{
e.Properties["cpPageSize"] = ((MVCxGridView)s).SettingsPager.PageSize;
Dictionary