Skip to main content

TreeList.NewItemRowText Property

Gets or sets the text displayed in the New Item Row when it is not focused.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

[DefaultValue("")]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public string NewItemRowText { get; set; }

Property Value

Type Default Description
String String.Empty

A string value that specifies the text displayed in the New Item Row when it is not focused.

Remarks

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”.

image

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.

Example

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);
        }
    }
}
See Also