| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Repository; |
| | | using System.Data; |
| | | using System.Windows.Controls; |
| | | using System.Windows.Forms; |
| | | using DevExpress.DataAccess.Wizard.Model; |
| | | using DevExpress.XtraEditors; |
| | | using Yw.Dto; |
| | | |
| | | namespace HStation.WinFrmUI.Basic |
| | | { |
| | |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView1.Columns["GroupName"].Group(); |
| | | repositoryItemCheckedComboBoxEdit1.DisplayMember = "Name"; |
| | | repositoryItemCheckedComboBoxEdit1.ValueMember = "ID"; |
| | | } |
| | | |
| | | private List<SysPropMappingViewModel> _allBindingList = new List<SysPropMappingViewModel>(); |
| | |
| | | var PropTreeList = await _bll.GetHaveListByCatalogID(ID); |
| | | foreach (var item in PropTreeList) |
| | | { |
| | | repositoryItemCheckedComboBoxEdit1.Items.Clear(); |
| | | |
| | | if (item.PropList.Count > 0) |
| | | { |
| | | foreach (var child in item.PropList) |
| | |
| | | model.DefaultValue = child.DefaultValue; |
| | | model.UnitName = child.UnitName; |
| | | model.Inherit = child.Inherit; |
| | | model.ChoiceList = child.ChoiceList; |
| | | // model.DisplayChoice = ; |
| | | // model.ChoiceIds = child.ChoiceList; |
| | | _allBindingList.Add(model); |
| | | } |
| | |
| | | |
| | | private void gridView1_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e) |
| | | { |
| | | /* if (quDaily.StatusEnum != QuDailyStatus.提交) |
| | | { |
| | | e.Cancel = true; |
| | | }*/ |
| | | var vm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | if (vm.Inherit) |
| | | { |
| | | e.Cancel = true; |
| | | } |
| | | if (gridView1.FocusedColumn.Name == "gridColumn1") |
| | | { |
| | | repositoryItemCheckedComboBoxEdit1.Items.Clear(); |
| | | repositoryItemCheckedComboBoxEdit1.DataSource = vm.ChoiceList; |
| | | // repositoryItemCheckedComboBoxEdit1.edit |
| | | } |
| | | } |
| | | |
| | | private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) |
| | | { |
| | | var gridView = sender as DevExpress.XtraGrid.Views.Grid.GridView; |
| | | if (gridView != null) |
| | | { |
| | | foreach (var item in _allBindingList) |
| | | { |
| | | int index = _allBindingList.IndexOf(item); |
| | | if (gridView.GetRowHandle(index) == e.RowHandle) |
| | | { |
| | | if (item.Inherit) |
| | | { |
| | | e.Appearance.BackColor = Color.Gray; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemCheckedComboBoxEdit1_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | var allselectList = repositoryItemCheckedComboBoxEdit1.GetCheckedItems(); |
| | | string[] parts = Convert.ToString(allselectList).Split(','); |
| | | List<long> longs = parts.Select(part => long.Parse(part.Trim())).ToList(); |
| | | var vm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (vm != null) |
| | | { |
| | | vm.ChoiceIds = longs; |
| | | } |
| | | } |
| | | } |
| | | } |