| | |
| | | InitializeComponent(); |
| | | this.gridView1.SetNormalView(30); |
| | | this.gridView1.RegistCustomDrawRowIndicator(40); |
| | | this.gridView1.ShowFindPanel(); |
| | | //this.gridView1.ShowFindPanel(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | this.peSucceed.Image = Yw.WinFrmUI.Hydro.Core.Properties.Resources.failed_64; |
| | | } |
| | | this.txtMode.EditValue = HydroCheckMode.Count(); |
| | | this.txtType.EditValue = HydroCheckType.Count(); |
| | | this.txtItems.EditValue = result.Items.Count; |
| | | this.txtSucceedItems.EditValue = result.Items.Count(x => !x.Failed); |
| | | this.txtFailedItems.EditValue = result.Items.Count(x => x.Failed); |
| | | this.txtMode.EditValue = $"{HydroCheckMode.Count()}种"; |
| | | this.txtType.EditValue = $"{HydroCheckType.Count()}类"; |
| | | this.txtItems.EditValue = $"{result.Items.Count}个"; |
| | | this.txtSucceedItems.EditValue = $"{result.Items.Count(x => !x.Failed)}个"; |
| | | this.txtFailedItems.EditValue = $"{result.Items.Count(x => x.Failed)}个"; |
| | | |
| | | _allBindingList = new List<HydroCheckItemViewModel>(); |
| | | foreach (var item in result.Items) |
| | |
| | | var vm = new HydroCheckItemViewModel(item); |
| | | _allBindingList.Add(vm); |
| | | } |
| | | _allBindingList = _allBindingList.OrderBy(x => x.SortCode).ToList(); |
| | | this.hydroCheckItemViewModelBindingSource.DataSource = _allBindingList; |
| | | this.hydroCheckItemViewModelBindingSource.ResetBindings(false); |
| | | } |
| | |
| | | this.HydroClickEvent?.Invoke(row.Code); |
| | | } |
| | | |
| | | //自定义单元格颜色 |
| | | private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) |
| | | { |
| | | var row = this.gridView1.GetRow(e.RowHandle) as HydroCheckItemViewModel; |
| | | if (row == null) |
| | | { |
| | | return; |
| | | } |
| | | if (e.RowHandle != this.gridView1.FocusedRowHandle) |
| | | { |
| | | if (row.Failed) |
| | | { |
| | | e.Appearance.BackColor = Color.Red; |
| | | e.Appearance.ForeColor = Color.White; |
| | | } |
| | | else |
| | | { |
| | | e.Appearance.BackColor = Color.Green; |
| | | e.Appearance.ForeColor = Color.White; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | e.Appearance.BackColor = Color.Orange; |
| | | e.Appearance.ForeColor = Color.White; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |