/// <summary> /// 加载ComboBox内容 /// /// </summary> public void LoadComboBox() { var Station = ScanLogInfo.GetScanStation(); ComboBox_Station.SetItemsSource(Station); DataGrid.Station = Station[0].Station; ComboBox_Station.SelectCallBack = (s) => { if (s == null) { return; } DataGrid.Station = s.Station; }; var ScanType = ScanLogInfo.GetScanType(); ComboBox_Type.SetItemsSource(ScanType); DataGrid.Scan_Type = ScanType[0].Type; ComboBox_Type.SelectCallBack = (s) => { if (s == null) { return; } DataGrid.Scan_Type = s.Type; }; }
protected void GetDDLStation() { try { ComboBox_Station.DataSource = AssignToolRepository.RetrieveStation(); ComboBox_Station.TextField = "StationName"; ComboBox_Station.Value = "-Select-"; ComboBox_Station.ValueField = "IdTool"; ComboBox_Station.DataBind(); } catch (Exception) { throw; } }