Skip to main content

RepositoryItemLookUpEdit.TextEditStyle Property

Gets or sets a value that specifies whether users can type in the lookup’s text box.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v22.2.dll

NuGet Package: DevExpress.Win.Navigation


public override TextEditStyles TextEditStyle { get; set; }

Property Value

Type Description

A TextEditStyles enumeration value.

Available values:

Name Description

A button editor works in its normal way. Editing and selecting text is allowed.



The text editing region is not visible and the editor displays only buttons contained in the current button editor. If no buttons can be displayed (for instance because of setting the EditorButton.Visible property to False), the editor displays an empty region in this case.



A button editor is displayed in its normal way. However, editing and selecting text is not allowed. If you want to enable a user to select text but disable text modifications, you can set the text editing style to Standard and set the RepositoryItem.ReadOnly property to true.



Set the TextEditStyle property to TextEditStyles.Standard to allow users to type in the text box. Handle the ProcessNewValue event to parse entered values and add new records to the lookup’s data source.

// Enables adding new values.
lookUpEdit1.Properties.TextEditStyle = TextEditStyles.Standard;
lookUpEdit1.ProcessNewValue += new ProcessNewValueEventHandler(

private void lookUpEdit1_ProcessNewValue(object sender, ProcessNewValueEventArgs e) {
    if((string)e.DisplayValue == String.Empty) return;
    List<Task> dataSource = (sender as LookUpEdit).Properties.DataSource as List<Task>;
    dataSource.Add(new Task(dataSource.Count) { Caption = (string)e.DisplayValue});
    e.Handled = true;
See Also