namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectSimulationPipeUnMatchingListCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationPipeUnMatchingListCtrl()
|
{
|
InitializeComponent();
|
this.gridView1.SetNormalView(30);
|
this.gridView1.RegistCustomDrawRowIndicator(40);
|
}
|
|
/// <summary>
|
/// 水力点击事件
|
/// </summary>
|
public event Action<Yw.Model.HydroPipeInfo> HydroClickEvent;
|
|
private List<XhsProjectSimulationPipeUnMatchingViewModel> _allBindingList = null;//所有绑定列表
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
/// <param name="allPipeList"></param>
|
public void SetBindingData(List<Yw.Model.HydroPipeInfo> allPipeList)
|
{
|
_allBindingList = new List<XhsProjectSimulationPipeUnMatchingViewModel>();
|
if (allPipeList != null && allPipeList.Count > 0)
|
{
|
foreach (var pipe in allPipeList)
|
{
|
if (string.IsNullOrEmpty(pipe.DbId))
|
{
|
var vm = new XhsProjectSimulationPipeUnMatchingViewModel(pipe);
|
_allBindingList.Add(vm);
|
}
|
}
|
}
|
this.xhsProjectSimulationPipeUnMatchingViewModelBindingSource.DataSource = _allBindingList;
|
this.xhsProjectSimulationPipeUnMatchingViewModelBindingSource.ResetBindings(false);
|
}
|
|
//行点击事件
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
{
|
var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationPipeUnMatchingViewModel;
|
if (row == null)
|
{
|
return;
|
}
|
this.HydroClickEvent?.Invoke(row.Vmo);
|
}
|
}
|
}
|