123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using OTSIncAReportApp.OTSSampleReportInfo;
- using SourceGrid;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OTSIncAReportApp.OTSDataMgrFunction
- {
- /// <summary>
- /// 与属性Grid操作事件对应的事件类,在该类中实现属性Grid的操作方法实现
- /// </summary>
- class ChangeGridCellValEvent : SourceGrid.Cells.Controllers.ControllerBase
- {
- #region 变量定义
- /// <summary>
- /// 属性Grid类对象全局变量
- /// </summary>
- OTSSourceGrid m_SourceGrid = null;
- private const int Constant = 1;
- #endregion
- #region 构造函数
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="SGrid"></param>
- public ChangeGridCellValEvent(OTSSourceGrid SGrid)
- {
- m_SourceGrid = SGrid;
- }
- #endregion
- #region 下拉框事件
- /// <summary>
- /// 属性Grid的下拉框下拉完成后,触发的事件。SourceGrid的事件不是用delegate方法实现的,与dot net 的标准事件实现方式不同,需要在这里override才可以
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
- {
-
- var changingItemId = (OTS_REPORT_PROP_GRID_ITEMS)m_SourceGrid.m_frmPropCondition.PropGrid.Rows[m_SourceGrid.m_ClickRow].Tag;
- ConditionItem item = m_SourceGrid.m_frmPropCondition.m_CurrentConditions[changingItemId];
- int selindex = 0;
-
- OTS_ITEM_TYPES ValType = item.iItemValType;
- switch (ValType)
- {
- case OTS_ITEM_TYPES.COMBO:
- item.itemDisplayVal = (string)m_SourceGrid.m_frmPropCondition.PropGrid[m_SourceGrid.m_ClickRow, 2].Value;
- selindex = item.comboDownList.IndexOf(item.itemDisplayVal.ToString());
- item.itemVal = selindex;
- break;
- case OTS_ITEM_TYPES.DOUBLE:
- var dValue = m_SourceGrid.m_frmPropCondition.PropGrid[m_SourceGrid.m_ClickRow, 2].Value;
- double v = Convert.ToDouble(dValue);
- item.itemDisplayVal = v;
- item.itemVal = v;
- break;
- default:
- break;
- }
- m_SourceGrid.m_frmPropCondition.DisCurrentPicProperty();
-
- }
- #endregion
- }
- /// <summary>
- /// 组合框类,与属性Grid关联
- /// </summary>
- class ItemValueChange2 : SourceGrid.Cells.Controllers.ControllerBase
- {
- OTSSourceGrid m_SampleGrid = null;
- public ItemValueChange2(OTSSourceGrid SGrid)
- {
- m_SampleGrid = SGrid;
- }
- public override void OnValueChanged(CellContext sender, EventArgs e)
- {
- //判断如果对选择颗粒,全部颗粒进行了重新选择的话
- if (sender.Position.Row == 2)
- m_SampleGrid.m_frmPropCondition.m_ReportApp.im_ParticlesGridDevidePage = null;//需要重新刷新颗粒列表
- m_SampleGrid.m_frmPropCondition.ShowDataDiagram(m_SampleGrid.m_frmPropCondition.tabIndex);
- //------------------------------------------------------------------------------------------------------------------
- m_SampleGrid.m_ClickRow = sender.Position.Row;
- if (m_SampleGrid.m_frmPropCondition.PropGrid.Rows[m_SampleGrid.m_ClickRow].Tag != null)
- {
- m_SampleGrid.m_frmPropCondition.m_ReportApp.m_RstWindow.SelectWorkSampleNode();
- }
- }
- }
- }
|