namespace HStation.WinFrmUI { public partial class PipeLineMatchingCtrl : DevExpress.XtraEditors.XtraUserControl { public PipeLineMatchingCtrl() { InitializeComponent(); this.gridView1.SetNormalView(30); this.gridView1.OptionsView.ShowDetailButtons = true; this.gridView1.OptionsView.ShowGroupPanel = false; } private List _allBindingList = null; /// /// 点击事件 /// public event Action RowClickEvent; public void SetBindingData(List pipeLineMatchingViewModels) { if (_allBindingList != null) { _allBindingList = pipeLineMatchingViewModels; this.pipeLineMatchingViewModelBindingSource.DataSource = _allBindingList; } } public List SetMatching(List inputs, List alllist) { if (inputs == null) { return null; } var finishList = new List(); foreach (var item in inputs) { var result = AsstesAutoMatchingHelper.PipeAutoMatching(item, alllist); if (result != null) { finishList.Add(result); } else { } } _allBindingList = finishList; this.pipeLineMatchingViewModelBindingSource.ResetBindings(false); return finishList; } //行点击事件 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { var row = this.gridView1.GetCurrentViewModel(_allBindingList); if (row == null) { return; } this.RowClickEvent?.Invoke(row.Code); } } }