/// <summary> /// 引发<see cref="SelectedDataValueChanged"/> 事件 /// </summary> /// <param name="e"></param> public void OnSelectedDataValueChanged(SelectedDataValueChangedEventArgs e) { if (this.SelectedDataValueChanged != null) { this.SelectedDataValueChanged(this, e); } }
// DataControl.SelectedDataValueChanged会触发DisplayManager.SelectedDataValueChanged会出发 void DisplayManager_SelectedDataValueChanged(object sender, SelectedDataValueChangedEventArgs e) { if (e.DataControlName == "任务性质") { 任务预备案_任务性质_SelectedDataValueChanged(e.Container, System.EventArgs.Empty); } }
static void DisplayManagerPzsfmx_SelectedDataValueChanged(object sender, SelectedDataValueChangedEventArgs e) { if (e.DataControlName == "收付款方式" || e.DataControlName == "收付标志") { Xceed.Grid.Cell cell = e.Container as Xceed.Grid.Cell; cell.ParentRow.Cells["票据号码"].ReadOnly = true; cell.ParentRow.Cells["银行账户编号"].ReadOnly = true; cell.ParentRow.Cells["出票银行"].ReadOnly = true; cell.ParentRow.Cells["承兑期限"].ReadOnly = true; cell.ParentRow.Cells["付款人编号"].ReadOnly = true; if (cell.ParentRow.Cells["收付款方式"].Value != null && cell.ParentRow.Cells["收付标志"].Value != null) { 收付标志 a = (收付标志)cell.ParentRow.Cells["收付标志"].Value; 收付款方式 b = (收付款方式)cell.ParentRow.Cells["收付款方式"].Value; switch (a) { case 收付标志.收: cell.ParentRow.Cells["票据号码"].ReadOnly = !(b == 收付款方式.现金支票 || b == 收付款方式.转账支票 || b == 收付款方式.银行承兑汇票 || b == 收付款方式.银行本票汇票); cell.ParentRow.Cells["银行账户编号"].ReadOnly = !(b == 收付款方式.转账支票 || b == 收付款方式.银行本票汇票 || b == 收付款方式.银行收付); cell.ParentRow.Cells["出票银行"].ReadOnly = !(b == 收付款方式.银行承兑汇票); cell.ParentRow.Cells["承兑期限"].ReadOnly = !(b == 收付款方式.银行承兑汇票); cell.ParentRow.Cells["付款人编号"].ReadOnly = !(b == 收付款方式.银行承兑汇票); if (b == 收付款方式.银行承兑汇票) { cell.ParentRow.Cells["付款人编号"].Value = (cell.ParentRow.GridControl.FindForm() as ArchiveDetailForm).DisplayManager.DataControls["相关人编号"].SelectedDataValue; } else { cell.ParentRow.Cells["付款人编号"].Value = null; } break; case 收付标志.付: cell.ParentRow.Cells["票据号码"].ReadOnly = !(b == 收付款方式.现金支票 || b == 收付款方式.转账支票 || b == 收付款方式.银行承兑汇票); cell.ParentRow.Cells["银行账户编号"].ReadOnly = !(b == 收付款方式.银行收付 || b == 收付款方式.电汇); cell.ParentRow.Cells["出票银行"].ReadOnly = true; cell.ParentRow.Cells["承兑期限"].ReadOnly = true; cell.ParentRow.Cells["付款人编号"].ReadOnly = true; break; } } } }
static void DisplayManagerPzfymx_SelectedDataValueChanged(object sender, SelectedDataValueChangedEventArgs e) { Xceed.Grid.Cell cell = e.Container as Xceed.Grid.Cell; IDisplayManager dm = sender as IDisplayManager; if (e.DataControlName == "费用项") { string fyx = (string)cell.ParentRow.Cells["费用项"].Value; if (fyx == "012") // 还借款 { cell.ParentRow.Cells["结算期限"].ReadOnly = false; } else { cell.ParentRow.Cells["结算期限"].ReadOnly = true; } } }
public static void 车辆_车主驾驶员_对应(object sender, SelectedDataValueChangedEventArgs e) { if (e.DataControlName == "车辆编号") { IDisplayManager dm = sender as IDisplayManager; IDataControl dc = e.Container as IDataControl; if (dc != null) { if (dc.SelectedDataValue != null) { 车辆 cl = EntityBufferCollection.Instance.Get<车辆>(dc.SelectedDataValue); if (cl != null) { if (dm.DataControls["车主编号"] != null && dm.DataControls["车主编号"].SelectedDataValue == null) { dm.DataControls["车主编号"].SelectedDataValue = cl.车主编号; } if (dm.DataControls["承运人编号"] != null && dm.DataControls["承运人编号"].SelectedDataValue == null) { dm.DataControls["承运人编号"].SelectedDataValue = cl.车主编号; } if (dm.DataControls["驾驶员编号"] != null && dm.DataControls["驾驶员编号"].SelectedDataValue == null) { dm.DataControls["驾驶员编号"].SelectedDataValue = cl.默认驾驶员编号; } } } } else { Xceed.Grid.Cell cell = e.Container as Xceed.Grid.Cell; if (cell.Value != null) { 车辆 cl = EntityBufferCollection.Instance.Get<车辆>(cell.Value); if (cl != null) { if (cell.ParentRow.Cells["车主编号"] != null && cell.ParentRow.Cells["车主编号"].Value == null) { cell.ParentRow.Cells["车主编号"].Value = cl.车主编号; } if (cell.ParentRow.Cells["承运人编号"] != null && cell.ParentRow.Cells["承运人编号"].Value == null) { cell.ParentRow.Cells["承运人编号"].Value = cl.车主编号; } if (cell.ParentRow.Cells["驾驶员编号"] != null && cell.ParentRow.Cells["驾驶员编号"].Value == null) { cell.ParentRow.Cells["驾驶员编号"].Value = cl.默认驾驶员编号; } } } } } }