using DevExpress.XtraEditors;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectSimulationHydroCheckFailedCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationHydroCheckFailedCtrl()
|
{
|
InitializeComponent();
|
this.gridView1.SetNormalView(30);
|
this.gridView1.RegistCustomDrawRowIndicator(40);
|
}
|
|
/// <summary>
|
/// 点击构件事件
|
/// </summary>
|
public event Action<string> HydroClickEvent;
|
|
private List<XhsProjectSimulationHydroCheckFailedViewModel> _allBindingList = null;
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(List<Yw.EPAnet.CheckFailed> allFailedList)
|
{
|
_allBindingList = new List<XhsProjectSimulationHydroCheckFailedViewModel>();
|
if (allFailedList != null && allFailedList.Count > 0)
|
{
|
foreach (var failed in allFailedList)
|
{
|
var vm = new XhsProjectSimulationHydroCheckFailedViewModel(failed);
|
_allBindingList.Add(vm);
|
}
|
}
|
this.xhsProjectSimulationHydroCheckFailedViewModelBindingSource.DataSource = _allBindingList;
|
this.xhsProjectSimulationHydroCheckFailedViewModelBindingSource.ResetBindings(false);
|
}
|
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
{
|
var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationHydroCheckFailedViewModel;
|
if (row == null)
|
{
|
return;
|
}
|
this.HydroClickEvent?.Invoke(row.ParterId);
|
}
|
|
|
}
|
}
|