private void BindContactDataByInterface(string plugno, RadMultiColumnComboBox cbPin) { //此处省略排序规则:字符串混合排序 this.Invoke(new Action(() => { var methodIndex = 2; if (this.rdb2Method.IsChecked) { methodIndex = 2; } else if (this.rdb4Method.IsChecked) { methodIndex = 4; } cbPin.EditorControl.Rows.Clear(); var resultList = ContactPointReSort(plugno, methodIndex); if (resultList.Count == 0) { return; } this.cb_startPin.EditorControl.BeginEdit(); int iStart = 0; foreach (var point in resultList) { cbPin.EditorControl.Rows.Add(iStart + 1); iStart++; } cbPin.EditorControl.EndEdit(); cbPin.SelectedIndex = 0; cbPin.EditorControl.ShowColumnHeaders = false; cbPin.EditorControl.ClearSelection(); cbPin.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; })); }
private void SetAssociatedRadMultiColumnComboBoxCore(RadMultiColumnComboBox radMultiColumnComboBox) { if (radMultiColumnComboBox == null) { return; } this.originalSize = radMultiColumnComboBox.Size; this.associatedRadMultiColumnComboBox = radMultiColumnComboBox; this.associatedRadMultiColumnComboBox.AutoSize = true; this.associatedRadMultiColumnComboBox.ThemeNameChanged += associatedRadMultiColumnComboBox_ThemeNameChanged; this.associatedRadMultiColumnComboBox.HandleCreated += associatedRadMultiColumnComboBox_HandleCreated; this.associatedRadMultiColumnComboBox.DataBindingComplete += associatedRadMultiColumnComboBox_DataBindingComplete; this.associatedRadMultiColumnComboBox.DropDownStyle = RadDropDownStyle.DropDownList; this.associatedRadMultiColumnComboBox.EditorControl.ViewCellFormatting += EditorControl_ViewCellFormatting; this.associatedRadMultiColumnComboBox.DropDownClosing += radMultiColumnCombobox1_DropDownClosing; this.autoCompleteBoxElement = new RadAutoCompleteBoxElement(); this.autoCompleteBoxElement.MinSize = new Size(150, 24); this.autoCompleteBoxElement.Multiline = true; this.autoCompleteBoxElement.DrawBorder = false; this.autoCompleteBoxElement.KeyDown += autoCompleteBoxElement_KeyDown; this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.ArrowButton.ZIndex = 1; this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.TextBoxElement.Visibility = ElementVisibility.Hidden; this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.Children[2].Children.Add(this.autoCompleteBoxElement); this.autoCompleteBoxElement.MaxSize = new Size(this.associatedRadMultiColumnComboBox.Size.Width - this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.ArrowButton.Size.Width, 0); this.autoCompleteBoxElement.AutoCompleteDataSource = new System.Collections.Generic.List <string>(GetAutoCompleteItems()); this.autoCompleteBoxElement.Margin = new System.Windows.Forms.Padding(0); this.autoCompleteBoxElement.Items.CollectionChanged += Items_CollectionChanged; this.autoCompleteBoxElement.CreateTextBlock += autoCompleteBoxElement_CreateTextBlock; this.autoCompleteBoxElement.TokenValidating += autoCompleteBoxElement_TokenValidating; }
private void SetAssociatedRadMultiColumnComboBox(RadMultiColumnComboBox radMultiColumnComboBox) { if (radMultiColumnComboBox == null && this.associatedRadMultiColumnComboBox != null) { this.SetAssociatedRadMultiColumnComboBoxCoreToNull(); } this.SetAssociatedRadMultiColumnComboBoxCore(radMultiColumnComboBox); }
public void HideColumn(RadMultiColumnComboBox radCombo) { foreach (GridViewDataColumn t in radCombo.MultiColumnComboBoxElement.Columns) { t.IsVisible = false; } radCombo.MultiColumnComboBoxElement.Columns[radCombo.DisplayMember].IsVisible = true; radCombo.MultiColumnComboBoxElement.Columns[radCombo.ValueMember].IsVisible = true; }
private void comboLigset(RadMultiColumnComboBox combo, RadMultiColumnComboBox combo2) { MLig lig = new MLig(); var lst = lig.GetLigs(); foreach (var item in lst) { Image newImage = Image.FromFile(item.Address); combo.MultiColumnComboBoxElement.Rows.Add(item.ID.ToString(), item.LigName.ToString(), newImage); combo2.MultiColumnComboBoxElement.Rows.Add(item.ID.ToString(), item.LigName.ToString(), newImage); } }
public static void InitMulCombox(RadMultiColumnComboBox comBox) { var data = libraryManager.GetDataSetByFieldsAndWhere("distinct InterfaceNo", "").Tables[0]; if (data.Rows.Count > 0) { foreach (DataRow dr in data.Rows) { comBox.EditorControl.Rows.Add(dr[0].ToString()); } comBox.EditorControl.ShowColumnHeaders = false; comBox.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; comBox.SelectedIndex = 0; } }
private bool IsExistCombox(RadMultiColumnComboBox interfaceCombox, string inputValue) { if (interfaceCombox.EditorControl.RowCount < 1) { return(false); } foreach (var rowInfo in interfaceCombox.EditorControl.Rows) { var value = rowInfo.Cells[0].Value.ToString(); if (value == inputValue) { return(true); } } return(false); }
private void comboTeamset(RadMultiColumnComboBox combo, int idlig) { TeamController team = new TeamController(); var lst = team.GetTeams(idlig); foreach (var item in lst) { if (item.LOGO != null) { Image newImage = Image.FromFile(item.LOGO); combo.MultiColumnComboBoxElement.Rows.Add(item.IDTeam.ToString(), item.TeamName.ToString(), newImage); } else { combo.MultiColumnComboBoxElement.Rows.Add(item.IDTeam.ToString(), item.TeamName.ToString(), ""); } } }
private void SetAssociatedRadMultiColumnComboBoxCoreToNull() { this.associatedRadMultiColumnComboBox.HandleCreated -= associatedRadMultiColumnComboBox_HandleCreated; this.associatedRadMultiColumnComboBox.DataBindingComplete -= associatedRadMultiColumnComboBox_DataBindingComplete; this.associatedRadMultiColumnComboBox.EditorControl.ViewCellFormatting -= EditorControl_ViewCellFormatting; this.associatedRadMultiColumnComboBox.DropDownClosing -= radMultiColumnCombobox1_DropDownClosing; this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.TextBoxElement.Visibility = ElementVisibility.Visible; this.associatedRadMultiColumnComboBox.MultiColumnComboBoxElement.Children[2].Children.Remove(autoCompleteBoxElement); this.autoCompleteBoxElement.MaxSize = new Size(0, 0); this.autoCompleteBoxElement.AutoCompleteDataSource = null; this.associatedRadMultiColumnComboBox.AutoSize = false; this.associatedRadMultiColumnComboBox.Size = this.originalSize; foreach (GridViewRowInfo item in this.associatedRadMultiColumnComboBox.EditorControl.Rows) { item.Tag = null; } this.autoCompleteBoxElement.Items.CollectionChanged -= Items_CollectionChanged; this.autoCompleteBoxElement.CreateTextBlock -= autoCompleteBoxElement_CreateTextBlock; this.autoCompleteBoxElement.TokenValidating -= autoCompleteBoxElement_TokenValidating; this.autoCompleteBoxElement.Text = this.associatedRadMultiColumnComboBox.Text; this.autoCompleteBoxElement.KeyDown -= autoCompleteBoxElement_KeyDown; this.associatedRadMultiColumnComboBox = null; this.rows.Clear(); }
private void TunuUpHeaderOfTheTables(RadMultiColumnComboBox dgw) { dgw.EditorControl.Columns[0].HeaderText = "Код продукции"; dgw.EditorControl.Columns[0].Width = 80; dgw.EditorControl.Columns[1].HeaderText = "Наименование"; dgw.EditorControl.Columns[1].Width = 150; dgw.EditorControl.Columns[2].HeaderText = "Обозначение"; dgw.EditorControl.Columns[2].Width = 150; dgw.EditorControl.Columns[3].HeaderText = "Вид продукции"; dgw.EditorControl.Columns[3].Width = 150; }
// извлекаем только сборочные единицы и детали private void LoadProducts3(RadMultiColumnComboBox dgw) { string str = @"SELECT ProductNames.ProductKey, ProductNames.Name, ProductNames.Designation, ReferenceProducts.Name FROM ProductNames INNER JOIN ReferenceProducts ON (ProductNames.ViewCode = ReferenceProducts.PKey) WHERE ProductNames.ViewCode = 1 or ProductNames.ViewCode = 2;"; dgw.DataSource = DBWorker.dbf.Execute(str); }