From aaed24ecaacb9a0cef8d95570bc89df94df42977 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 07 三月 2025 14:34:28 +0800
Subject: [PATCH] 受托
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 102 ++++++++++++++++++++++++---------------------------
1 files changed, 48 insertions(+), 54 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index debc890..faebd02 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -10,7 +10,6 @@
using System.Net.Http;
using System.Reflection;
using System.Resources;
-using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -791,14 +790,14 @@
if (ctrl is CheckEdit)
{
var txt = ctrl as CheckEdit;
- txt.ReadOnly = isEdt;
- if (txt.Tag != null && txt.Tag.ToString().Length > 0 && txt.Tag.ToString().StartsWith("moren"))
+ if (_isRead(txt.Tag))
{
- txt.Checked = bool.Parse(txt.Tag.ToString().Replace("moren.", ""));
+ txt.ReadOnly = true;
}
else
- txt.Checked = false;
+ txt.ReadOnly = isEdt;
continue;
+
}
//鑷畾涔変粨搴�
if (ctrl is UcLookCk)
@@ -1730,6 +1729,28 @@
/// <param name="action"></param>
public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null)
{
+ gridView1.PopupMenuShowing += (s, e) =>
+ {
+ if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
+ {
+ GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
+ if (menu != null)
+ {
+ string[] ary = { "Column Chooser", "Hide This Column", "Clear All Sorting", "Clear Sorting", "Sort Descending", "Sort Ascending", "Best Fit (all columns)" };
+ for (int i = menu.Items.Count - 1; i >= 0; i--)
+ {
+ string _caption = menu.Items[i].Caption;
+ if (!ary.Contains(_caption))
+ {
+ menu.Items.Remove(menu.Items[i]);
+ }
+ }
+ }
+ }
+ };
+ gridView1.OptionsView.ShowGroupPanel = false;
+ gridView1.OptionsCustomization.AllowGroup = false;
+
gridView1.Appearance.HeaderPanel.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.ControlText;
gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀
foreach (GridColumn column in gridView1.Columns)
@@ -1890,6 +1911,28 @@
/// <param name="icoName"></param>
public static void SetGridViewParameterMx(GridView gridView1)
{
+ gridView1.PopupMenuShowing += (s, e) =>
+ {
+ if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
+ {
+ GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
+ if (menu != null)
+ {
+ string[] ary = { "Column Chooser", "Hide This Column", "Clear All Sorting", "Clear Sorting", "Sort Descending", "Sort Ascending", "Best Fit (all columns)" };
+ for (int i = menu.Items.Count - 1; i >= 0; i--)
+ {
+ string _caption = menu.Items[i].Caption;
+ if (!ary.Contains(_caption))
+ {
+ menu.Items.Remove(menu.Items[i]);
+ }
+ }
+ }
+ }
+ };
+ gridView1.OptionsView.ShowGroupPanel = false;
+ gridView1.OptionsCustomization.AllowGroup = false;
+
// gridView1.OptionsView.Alignment = DataGridViewContentAlignment.MiddleLeft;
foreach (GridColumn column in gridView1.Columns)
{
@@ -2012,55 +2055,6 @@
}
}
- }
-
- public static void getXmlConfig(string namespaceFullName, List<DevExpress.XtraGrid.Views.Grid.GridView> gvList)
- {
- // gridView1.ShowCustomization();
- // gridView1.OptionsMenu.EnableColumnMenu = false;
- JArray array = new JArray();
- var _obj = new
- {
- formPath = namespaceFullName,
- };
- try
- {
- string strJson = UtilityHelper.HttpPost("", "Fm/GetModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- JObject _job = JObject.Parse(strJson);
- foreach (var a in _job["rtnData"]["list"])
- {
- //string _id = a["controlId"].ToString();
- //string _controlType = a["controlType"].ToString();
- //string _controlXml = a["controlXml"].ToString();
- //string _splitterPosition = a["splitterPosition"].ToString();
- array.Add(a);
- }
- foreach (GridView gridView1 in gvList)
- {
- JToken john = array.FirstOrDefault(t => t["controlId"].ToString().ToUpper() == gridView1.Name.ToString().Trim().ToUpper());
- if (john != null)
- {
- string controlId = john["controlId"].ToString();
- string controlXml = john["controlXml"].ToString();
- byte[] byteArray = Encoding.UTF8.GetBytes(controlXml);
- using (var stream = new MemoryStream(byteArray))
- {
- gridView1.RestoreLayoutFromStream(stream);
- }
- }
- }
- }
- else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- }
- catch (Exception ex)
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
-
}
}
--
Gitblit v1.9.3