lixiaojun
2024-09-27 97c4b1bc4ca88c5487f8ae38a0da32c93b66c4ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationThreelinkUnMatchingListCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public XhsProjectSimulationThreelinkUnMatchingListCtrl()
        {
            InitializeComponent();
            this.gridView1.SetNormalView(30);
            this.gridView1.RegistCustomDrawRowIndicator(40);
        }
 
        /// <summary>
        /// 显示查询面板
        /// </summary>
        [Browsable(true)]
        [Description("显示查询面板")]
        [DefaultValue(true)]
        public bool ShowFindPanel
        {
            get { return this.gridView1.OptionsFind.AlwaysVisible; }
            set { this.gridView1.OptionsFind.AlwaysVisible = value; }
        }
 
        /// <summary>
        /// 水力点击事件
        /// </summary>
        public event Action<Yw.Model.HydroThreelinkInfo> HydroClickEvent;
 
        private List<XhsProjectSimulationThreelinkUnMatchingViewModel> _allBindingList = null;//所有绑定列表
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="allThreelinkList"></param>
        public void SetBindingData(List<Yw.Model.HydroThreelinkInfo> allThreelinkList)
        {
            _allBindingList = new List<XhsProjectSimulationThreelinkUnMatchingViewModel>();
            if (allThreelinkList != null && allThreelinkList.Count > 0)
            {
                foreach (var threelink in allThreelinkList)
                {
                    if (string.IsNullOrEmpty(threelink.DbId))
                    {
                        var vm = new XhsProjectSimulationThreelinkUnMatchingViewModel(threelink);
                        _allBindingList.Add(vm);
                    }
                }
            }
            this.xhsProjectSimulationThreelinkUnMatchingViewModelBindingSource.DataSource = _allBindingList;
            this.xhsProjectSimulationThreelinkUnMatchingViewModelBindingSource.ResetBindings(false);
        }
 
        //行点击事件
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationThreelinkUnMatchingViewModel;
            if (row == null)
            {
                return;
            }
            this.HydroClickEvent?.Invoke(row.Vmo);
        }
    }
}