namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectSimulationValveUnMatchingListCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationValveUnMatchingListCtrl()
|
{
|
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.HydroValveInfo> HydroClickEvent;
|
|
private List<XhsProjectSimulationValveUnMatchingViewModel> _allBindingList = null;//所有绑定列表
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
/// <param name="allValveList"></param>
|
public void SetBindingData(List<Yw.Model.HydroValveInfo> allValveList)
|
{
|
_allBindingList = new List<XhsProjectSimulationValveUnMatchingViewModel>();
|
if (allValveList != null && allValveList.Count > 0)
|
{
|
foreach (var valve in allValveList)
|
{
|
if (string.IsNullOrEmpty(valve.DbId))
|
{
|
var vm = new XhsProjectSimulationValveUnMatchingViewModel(valve);
|
_allBindingList.Add(vm);
|
}
|
}
|
}
|
this.xhsProjectSimulationValveUnMatchingViewModelBindingSource.DataSource = _allBindingList;
|
this.xhsProjectSimulationValveUnMatchingViewModelBindingSource.ResetBindings(false);
|
}
|
|
//行点击事件
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
{
|
var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationValveUnMatchingViewModel;
|
if (row == null)
|
{
|
return;
|
}
|
this.HydroClickEvent?.Invoke(row.Vmo);
|
}
|
}
|
}
|