Back to Devexpress

RepositoryItemLookUpEdit.MaxDisplayTextLength Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemlookupedit-86bae77e.md

latest2.8 KB
Original Source

RepositoryItemLookUpEdit.MaxDisplayTextLength Property

Gets or sets the maximum number of characters displayed in the edit box.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[DefaultValue(255)]
[DXCategory("Behavior")]
public int MaxDisplayTextLength { get; set; }
vb
<DXCategory("Behavior")>
<DefaultValue(255)>
<Browsable(False)>
Public Property MaxDisplayTextLength As Integer

Property Value

TypeDefaultDescription
Int32255

The maximum number of characters displayed in the edit box. The minimum value is 10.

|

Remarks

This property works in Multiple Item Selection mode only. If the total number of characters in the edit box exceeds the MaxDisplayTextLength, the editor displays the ellipsis after the last item. The LookUpEdit displays the last item completely even if it does not fully fit the MaxDisplayTextLength.

csharp
public Form1() {
    // ...
    lookUpEdit1.Properties.DataSource = Employee.GetSampleData();
    lookUpEdit1.Properties.DisplayMember = "FullName";
    lookUpEdit1.Properties.ValueMember = "ID";
    lookUpEdit1.Properties.EditValueType = DevExpress.XtraEditors.Repository.LookUpEditValueType.ValueList;
    lookUpEdit1.Properties.MaxDisplayTextLength = 15;
}
vb
Public Sub New()
    ' ...
    lookUpEdit1.Properties.DataSource = Employee.GetSampleData()
    lookUpEdit1.Properties.DisplayMember = "FullName"
    lookUpEdit1.Properties.ValueMember = "ID"
    lookUpEdit1.Properties.EditValueType = DevExpress.XtraEditors.Repository.LookUpEditValueType.ValueList
    lookUpEdit1.Properties.MaxDisplayTextLength = 15
End Sub

See Also

RepositoryItemLookUpEdit Class

RepositoryItemLookUpEdit Members

DevExpress.XtraEditors.Repository Namespace