The essence of the problem is as follows: I am writing an application under WIN in C #. I use gridControl, in which for the GraidID field I want to use ColumnEditor = repositoryLookUpEdit

DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit rilu = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit(); rilu.DisplayMember = "Code"; rilu.ValueMember = "GraidID"; rilu.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Code", "Код", 60)); rilu.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Dolg", "Должность", 240)); rilu.PopupWidth = 300; rilu.Name = "MyRepository"; gridControl1.RepositoryItems.Add(rilu); 

When the ComboFgraid value changes, the DataSource is populated.

  private void comboFGraid_SelectedValueChanged(object sender, EventArgs e) { if (comboFGraid.SelectedValue != null && comboFGraid.SelectedValue.GetType() == typeof(String)) { lookUpEdit1.Properties.DataSource = DBProcedure.Dolgnost(comboFGraid.SelectedValue); (gridControl1.RepositoryItems["MyRepository"] as DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit).DataSource = DBProcedure.Dolgnost(comboFGraid.SelectedValue); } } 

I see the following on the screen:

enter image description here

PopUpList is unavailable

I do the same for the LookUpEdit object.

  lookUpEdit1.Properties.DisplayMember = rilu.DisplayMember; lookUpEdit1.Properties.ValueMember = rilu.ValueMember; lookUpEdit1.Properties.Columns.Add(rilu.Columns[0]); lookUpEdit1.Properties.Columns.Add(rilu.Columns[1]); lookUpEdit1.Properties.PopupWidth = rilu.PopupWidth; 

Those. all properties match repositoryLookUpEdit

Result on the screen

enter image description here

PopUpList appears all working.

Someone faced a similar problem. Help.

  • The property to which the Code column is attached is not editable (PropertyDescriptor.AllowEdit = false). Or editing is disabled in the options of the grid itself - Uranus

0