SVN r826
SVN-Revision: r826
This commit is contained in:
@@ -407,6 +407,7 @@ namespace Lskj.Control
|
|||||||
this.gridView.CustomDrawGroupRow += new RowObjectCustomDrawEventHandler(OnGridCustomDrawGroupRow);
|
this.gridView.CustomDrawGroupRow += new RowObjectCustomDrawEventHandler(OnGridCustomDrawGroupRow);
|
||||||
this.gridView.KeyDown += new KeyEventHandler(OnGridViewKeyDown);
|
this.gridView.KeyDown += new KeyEventHandler(OnGridViewKeyDown);
|
||||||
this.gridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
|
this.gridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
|
||||||
|
this.gridView.Click += new EventHandler(OnGridViewClick);
|
||||||
this.gridView.CellMerge += new CellMergeEventHandler(OnGridViewCellMerge);
|
this.gridView.CellMerge += new CellMergeEventHandler(OnGridViewCellMerge);
|
||||||
this.gridView.CustomSummaryCalculate += new CustomSummaryEventHandler(OnGridViewSummaryCalculate);
|
this.gridView.CustomSummaryCalculate += new CustomSummaryEventHandler(OnGridViewSummaryCalculate);
|
||||||
this.gridView.OptionsNavigation.EnterMoveNextColumn = true;
|
this.gridView.OptionsNavigation.EnterMoveNextColumn = true;
|
||||||
@@ -971,8 +972,8 @@ namespace Lskj.Control
|
|||||||
break;
|
break;
|
||||||
case ControlType.LabGridPopupValue:
|
case ControlType.LabGridPopupValue:
|
||||||
case ControlType.LabGridPopupText:
|
case ControlType.LabGridPopupText:
|
||||||
//case ControlType.LabGridPopupMutilValue:
|
//case ControlType.LabGridPopupMutilValue:
|
||||||
//case ControlType.LabGridPopupMutilText:
|
//case ControlType.LabGridPopupMutilText:
|
||||||
InitGridPopup(column, model);
|
InitGridPopup(column, model);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -4237,7 +4238,7 @@ namespace Lskj.Control
|
|||||||
GridColumnModel model = frmGridSelectPopup.Tag as GridColumnModel;
|
GridColumnModel model = frmGridSelectPopup.Tag as GridColumnModel;
|
||||||
|
|
||||||
string sql = ReplaceHelper.ReplaceRowParam(this.GridView.GetFocusedDataRow(), model.SqlSource);
|
string sql = ReplaceHelper.ReplaceRowParam(this.GridView.GetFocusedDataRow(), model.SqlSource);
|
||||||
frmGridSelectPopup.InitNew(sql, btnEdit.Text, btnEdit.EditValue+"");
|
frmGridSelectPopup.InitNew(sql, btnEdit.Text, btnEdit.EditValue + "");
|
||||||
DialogResult result = frmGridSelectPopup.ShowDialog();
|
DialogResult result = frmGridSelectPopup.ShowDialog();
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
@@ -4266,7 +4267,6 @@ namespace Lskj.Control
|
|||||||
hyperLinkEdit.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
|
hyperLinkEdit.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
|
||||||
// 设置超链接点击事件
|
// 设置超链接点击事件
|
||||||
hyperLinkEdit.Click += HyperLinkEdit_Click;
|
hyperLinkEdit.Click += HyperLinkEdit_Click;
|
||||||
this.gridView.OptionsBehavior.EditorShowMode = EditorShowMode.MouseDown;
|
|
||||||
|
|
||||||
hyperLinkEdit.SingleClick = true;
|
hyperLinkEdit.SingleClick = true;
|
||||||
hyperLinkEdit.Tag = model;
|
hyperLinkEdit.Tag = model;
|
||||||
@@ -4297,7 +4297,6 @@ namespace Lskj.Control
|
|||||||
hyperLinkEdit.SingleClick = true;
|
hyperLinkEdit.SingleClick = true;
|
||||||
hyperLinkEdit.Tag = model;
|
hyperLinkEdit.Tag = model;
|
||||||
|
|
||||||
this.gridView.OptionsBehavior.EditorShowMode = EditorShowMode.MouseDown;
|
|
||||||
// 注册编辑器
|
// 注册编辑器
|
||||||
gridControl.RepositoryItems.Add(hyperLinkEdit);
|
gridControl.RepositoryItems.Add(hyperLinkEdit);
|
||||||
gridColumn.OptionsColumn.ReadOnly = true;
|
gridColumn.OptionsColumn.ReadOnly = true;
|
||||||
@@ -7008,6 +7007,40 @@ namespace Lskj.Control
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 表格单击逻辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void OnGridViewClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Point gcPoint = gridControl.PointToScreen(gridControl.Location);
|
||||||
|
Point pt = new Point(MousePosition.X - gcPoint.X, MousePosition.Y - gcPoint.Y);
|
||||||
|
GridHitInfo _hitInfo = GridView.CalcHitInfo(pt);
|
||||||
|
if (_hitInfo != null && _hitInfo.InRowCell && _hitInfo.Column.ColumnEdit is RepositoryItemHyperLinkEdit hyperLinkEdit)
|
||||||
|
{
|
||||||
|
if (_hitInfo.Column.Tag is GridColumnModel gridColumnModel)
|
||||||
|
{
|
||||||
|
if (gridColumnModel.FieldType == ControlType.LabHyperlink)
|
||||||
|
{
|
||||||
|
HyperLinkEdit_Click(hyperLinkEdit, null);
|
||||||
|
}
|
||||||
|
else if (gridColumnModel.FieldType == ControlType.LabRightlink)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
|
||||||
|
MessageUtil.Show(Message, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// <para>说明:</para>
|
/// <para>说明:</para>
|
||||||
/// <para>创建人:龚宇超</para>
|
/// <para>创建人:龚宇超</para>
|
||||||
/// <para>创建日期:2019-06-10 </para>
|
/// <para>创建日期:2019-06-10 </para>
|
||||||
@@ -8790,4 +8823,30 @@ namespace Lskj.Control
|
|||||||
{
|
{
|
||||||
// 只处理列名可解析成日期的列
|
// 只处理列名可解析成日期的列
|
||||||
if (!DateTime.TryParse(col.FieldName, out _))
|
if (!DateTime.TryParse(col.FieldName, out _))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// 取 “Sum” 合计
|
||||||
|
var sumItem = col.Summary
|
||||||
|
.OfType<GridColumnSummaryItem>()
|
||||||
|
.FirstOrDefault(s => s.SummaryType == SummaryItemType.Sum);
|
||||||
|
|
||||||
|
bool needRed = false;
|
||||||
|
|
||||||
|
if (sumItem?.SummaryValue != null &&
|
||||||
|
decimal.TryParse(sumItem.SummaryValue.ToString(), out var colSum) &&
|
||||||
|
jhrowitem.Table.Columns.Contains(col.FieldName) &&
|
||||||
|
decimal.TryParse(jhrowitem[col.FieldName].ToString(), out var planVal))
|
||||||
|
{
|
||||||
|
needRed = (colSum != planVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只改表头文字颜色
|
||||||
|
col.AppearanceHeader.ForeColor = needRed ? Color.Red : Color.Black;
|
||||||
|
col.AppearanceHeader.Options.UseForeColor = true;
|
||||||
|
}
|
||||||
|
// 立刻刷新表头
|
||||||
|
gridView.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user