/// <summary> /// 그리드 내 필수값 컬럼 Editing 여부 처리 (해당 이벤트를 사용하는 경우 Xaml단 TableView 테그내 isEnabled 속성을 정의해야 한다.) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void View_ShowingEditor(object sender, ShowingEditorEventArgs e) { try { if (g_IsAuthAllYN == false) { e.Cancel = true; return; } #region + Master Grid TableView tv = sender as TableView; MasterView masterView = tv.Grid.CurrentItem as MasterView; if (masterView == null) { return; } switch (e.Column.FieldName) { case "RECIRCULATION_COUNT": if (masterView.IS_EDITABLE_RECIRCULATION_COUNT.Equals("N")) { e.Cancel = true; } break; case "TYPE_ALLOC_NM": if (masterView.IS_EDITABLE_TYPE_ALLOC.Equals("N")) { e.Cancel = true; } break; } #endregion #region + Detail Grid ChuteMapView mapView = tv.Grid.CurrentItem as ChuteMapView; if (mapView == null) { return; } switch (e.Column.FieldName) { case "FR_RCV_DAYS": case "TO_RCV_DAYS": if (mapView.IS_EDITABLE_RCV_DAYS.Equals("N")) { e.Cancel = true; } break; } #endregion } catch { throw; } }
/// <summary> /// Row 추가 버튼 클릭 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnRowAdd_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { try { int iCurrentGridRow = this.BaseClass.GetCurrentGridControlRowIndex(this.tvLeftGrid); var strCfgGrpCD = this.MasterViewList[iCurrentGridRow].CFG_GRP_CODE; // 그룹코드 var strCfgGrpNM = this.MasterViewList[iCurrentGridRow].CFG_GRP_NM; // 그룹명 var strCfgDtlCD = this.MasterViewList[iCurrentGridRow].CFG_DTL_CODE; // 상세코드 var strCfgDtlNM = this.MasterViewList[iCurrentGridRow].CFG_DTL_NAME; // 상세명 var strTypeAllocNM = this.MasterViewList[iCurrentGridRow].TYPE_ALLOC_NM; var strTypeAlloc = this.MasterViewList[iCurrentGridRow].TYPE_ALLOC; var newItme = new ChuteMapView { CFG_GRP_NM = strCfgGrpNM // 그룹명 , CFG_DTL_NM = strCfgDtlNM // 상세명 , CHUTE_NO = "0" // 슈트번호 , FR_RCV_DAYS = "0" // 재고소요일수 (시작) , TO_RCV_DAYS = "0" // 재고소요일수 (종료) , ISVALID = "Y" // 사용유무 , ISVALID_CHECKED = true , DT_UPD = DateTime.Now // 수정일시 , IS_EDITABLE_RCV_DAYS = "N" , DISPLAY_SEQ = 0 , CFG_GRP_CODE = strCfgGrpCD // 그룹코드 , CFG_DTL_CODE = strCfgDtlCD // 상세코드 , STATUS_SORTER = string.Empty , TYPE_ALLOC_NM = strTypeAllocNM , TYPE_ALLOC = strTypeAlloc , RECIRCULATION_COUNT = "0" , ID_REG = string.Empty , DT_REG = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") , ID_UPD = string.Empty , IsSelected = true , IsNew = true }; this.ChuteMapViewList.Add(newItme); this.gridRight.Focus(); this.gridRight.CurrentColumn = this.gridRight.Columns.First(); this.gridRight.View.FocusedRowHandle = this.ChuteMapViewList.Count - 1; this.ChuteMapViewList[this.ChuteMapViewList.Count - 1].BackgroundBrush = new SolidColorBrush(Colors.White); this.ChuteMapViewList[this.ChuteMapViewList.Count - 1].BaseBackgroundBrush = new SolidColorBrush(Colors.White); this.BaseClass.SetGridRowAddFocuse(this.gridRight, this.ChuteMapViewList.Count - 1); } catch (Exception err) { this.BaseClass.Error(err); } }