| | |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using DevExpress.DataAccess.Native.EntityFramework; |
| | | using DevExpress.Utils; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Controls; |
| | | using DevExpress.XtraGrid; |
| | | using DevExpress.XtraGrid.Columns; |
| | | using DevExpress.XtraGrid.Menu; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using DevExpress.XtraTab; |
| | | using DevExpress.XtraTreeList; |
| | | using Gs.DevApp.Entity; |
| | |
| | | if (cols.Length > 0) |
| | | { |
| | | var colType = cols[0]; |
| | | |
| | | if (colType is LookUpEdit) |
| | | { |
| | | var txt = colType as LookUpEdit; |
| | |
| | | else |
| | | txt.Text = strVal; |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | if (colType is ButtonEdit) |
| | | { |
| | | var txt = colType as ButtonEdit; |
| | | if (txt != null) |
| | | txt.Text = strVal; |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | //文本 |
| | |
| | | txt.Text = strVal; |
| | | } |
| | | } |
| | | |
| | | //自定义仓库 |
| | | if (colType is UcLookCk) |
| | | { |
| | |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | if (ctrl is ButtonEdit) |
| | | { |
| | | var txt = ctrl as ButtonEdit; |
| | | txt.Text = ""; |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | //文本 |
| | | if (ctrl is TextEdit) |
| | | { |
| | |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //自定部门 |
| | | if (ctrl is UcLookDepartment) |
| | | { |
| | |
| | | } |
| | | foreach (Control ctrl in controls) |
| | | { |
| | | //下拉 |
| | | if (ctrl is ComboBoxEdit) |
| | | { |
| | | var txt = ctrl as ComboBoxEdit; |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | if (ctrl is ButtonEdit) |
| | | { |
| | | var txt = ctrl as ButtonEdit; |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | //文本 |
| | | if (ctrl is TextEdit) |
| | | { |
| | |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | |
| | | //日期 |
| | | if (ctrl is DateTimePicker) |
| | | { |
| | | ctrl.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | |
| | | //单选 |
| | | if (ctrl is CheckBox) |
| | | { |
| | |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //自定部门 |
| | | if (ctrl is UcLookDepartment) |
| | | { |
| | |
| | | /// <param name="fileName">字段</param> |
| | | /// <param name="icoName">图标路径</param> |
| | | /// <param name="action"></param> |
| | | public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null) |
| | | public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null) |
| | | { |
| | | gridView1.PopupMenuShowing += (s, e) => |
| | | { |
| | |
| | | //} |
| | | } |
| | | }; |
| | | |
| | | |
| | | if (tips != null) |
| | | { |
| | | tips.Appearance.BackColor = Color.LightBlue; // 设置背景颜色 |
| | | tips.Appearance.ForeColor = Color.Black; // 设置前景色(文字颜色) |
| | | gridView1.MouseMove += (s, e) => |
| | | { |
| | | try |
| | | { |
| | | GridHitInfo hi = gridView1.CalcHitInfo(new Point(e.X, e.Y)); |
| | | if (hi.InRowCell) |
| | | { |
| | | int cuRowHandle = hi.RowHandle; |
| | | if (cuRowHandle < 0) |
| | | return; |
| | | DataRow curRow = gridView1.GetDataRow(cuRowHandle); |
| | | var column = hi.Column; |
| | | string showTxt = curRow[column.FieldName].ToString(); |
| | | ToolTipControllerShowEventArgs aa = new ToolTipControllerShowEventArgs(); |
| | | aa.AllowHtmlText = DefaultBoolean.True; |
| | | aa.Title = column.Caption; //HTML, 粗体 |
| | | aa.ToolTip = showTxt; //断行 |
| | | aa.ShowBeak = true; |
| | | aa.Rounded = true; ////圆角 |
| | | aa.RoundRadius = 7; //圆角率 |
| | | // aa.ToolTipType = ToolTipType.SuperTip; //超级样式,可多行或显示图标 |
| | | aa.ToolTipType = ToolTipType.Standard;//标准样式,可显示鸟嘴。 |
| | | aa.IconType = ToolTipIconType.Information; //消息图标 |
| | | aa.IconSize = ToolTipIconSize.Small; //大图标 |
| | | tips.ShowHint(aa); |
| | | } |
| | | else |
| | | tips.HideHint(); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e) |
| | | { |