windowsforms-devexpress-dot-xtratreelist-dot-treelist-04731de5.md
Gets or sets the text displayed in the New Item Row when it is not focused.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[DefaultValue("")]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public string NewItemRowText { get; set; }
<DefaultValue("")>
<XtraSerializableProperty>
<DXCategory("Appearance")>
Public Property NewItemRowText As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
A string value that specifies the text displayed in the New Item Row when it is not focused.
|
When the New Item Row is located at the top of the list, it displays the default caption — “Click here to add a new row”.
You can use the localization service to localize the default text. Use the TreeListStringId.NewItemRowText field to identify the string.
You can also use the TreeList.NewItemRowText property to provide a custom text. This custom text cannot be localized.
See New Item Row for more information.
The code below shows how to use the localization service to localize the text displayed in the New Item Row. Use the TreeListStringId.NewItemRowText field to identify the string.
using DevExpress.XtraTreeList.Localization;
TreeListLocalizer.Active = new NodeContextMenuLocalizer();
public class NodeContextMenuLocalizer : TreeListLocalizer {
public override string Language { get { return "English"; } }
public override string GetLocalizedString(TreeListStringId id) {
switch (id) {
case TreeListStringId.NewItemRowText: return "New Node";
default: return base.GetLocalizedString(id);
}
}
}
Imports DevExpress.XtraTreeList.Localization
TreeListLocalizer.Active = New NodeContextMenuLocalizer()
Public Class NodeContextMenuLocalizer
Inherits TreeListLocalizer
Public Overrides ReadOnly Property Language() As String
Get
Return "English"
End Get
End Property
Public Overrides Function GetLocalizedString(ByVal id As TreeListStringId) As String
Select Case id
Case TreeListStringId.NewItemRowText
Return "New Node"
Case Else
Return MyBase.GetLocalizedString(id)
End Select
End Function
End Class
See Also