namespace HStation.WinFrmUI
{
public partial class XhsProjectSimulationFourlinkUnMatchingListCtrl : DevExpress.XtraEditors.XtraUserControl
{
public XhsProjectSimulationFourlinkUnMatchingListCtrl()
{
InitializeComponent();
this.gridView1.SetNormalView(30);
this.gridView1.RegistCustomDrawRowIndicator(40);
}
///
/// 显示查询面板
///
[Browsable(true)]
[Description("显示查询面板")]
[DefaultValue(true)]
public bool ShowFindPanel
{
get { return this.gridView1.OptionsFind.AlwaysVisible; }
set { this.gridView1.OptionsFind.AlwaysVisible = value; }
}
///
/// 水力点击事件
///
public event Action HydroClickEvent;
private List _allBindingList = null;//所有绑定列表
///
/// 绑定数据
///
///
public void SetBindingData(List allFourlinkList)
{
_allBindingList = new List();
if (allFourlinkList != null && allFourlinkList.Count > 0)
{
foreach (var fourlink in allFourlinkList)
{
if (string.IsNullOrEmpty(fourlink.DbId))
{
var vm = new XhsProjectSimulationFourlinkUnMatchingViewModel(fourlink);
_allBindingList.Add(vm);
}
}
}
this.xhsProjectSimulationFourlinkUnMatchingViewModelBindingSource.DataSource = _allBindingList;
this.xhsProjectSimulationFourlinkUnMatchingViewModelBindingSource.ResetBindings(false);
}
//行点击事件
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
{
var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationFourlinkUnMatchingViewModel;
if (row == null)
{
return;
}
this.HydroClickEvent?.Invoke(row.Vmo);
}
}
}