Skip to main content
All docs
V25.2
  • DxTreeListCommandColumn.DisplayMode Property

    Specifies whether command buttons display icons, captions, or both.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    Declaration

    [DefaultValue(TreeListCommandColumnDisplayMode.Icon)]
    [Parameter]
    public TreeListCommandColumnDisplayMode DisplayMode { get; set; }

    Property Value

    Type Default Description
    TreeListCommandColumnDisplayMode Icon

    An enumeration value.

    Available values:

    Name Description Image
    Icon

    Command buttons display icons.

    Icon Display Mode

    Text

    Command buttons display captions.

    Text Display Mode

    IconAndText

    Command buttons display captions and icons.

    IconAndText Display Mode

    Remarks

    In the following example, the TreeList component displays both icons and captions in command buttons:

    IconAndText Display Mode

    @inject EmployeeTaskService EmployeeTaskService
    
    <DxTreeList Data="TreeListData"
                KeyFieldName="Id"
                ParentKeyFieldName="ParentId"
                ShowFilterRow="true"
                EditModelSaving="TreeList_EditModelSaving"
                DataItemDeleting="TreeList_DataItemDeleting"
                CustomizeEditModel="TreeList_CustomizeEditModel">
        <Columns>
            <DxTreeListCommandColumn DisplayMode="TreeListCommandColumnDisplayMode.IconAndText" />
            <DxTreeListDataColumn FieldName="Name" Caption="Task" />
            <DxTreeListDataColumn FieldName="EmployeeName" />
            <DxTreeListDataColumn FieldName="DueDate" />
        </Columns>
    </DxTreeList>
    
    @code {
        List<EmployeeTask> TreeListData { get; set; }
    
        protected override void OnInitialized() {
            TreeListData = EmployeeTaskService.GenerateData();
        }
        void TreeList_CustomizeEditModel(TreeListCustomizeEditModelEventArgs e) {
            if(e.IsNew) {
                var newTask = (EmployeeTask)e.EditModel;
                newTask.Id = TreeListData.Max(x => x.Id) + 1;
                if(e.ParentDataItem != null)
                    newTask.ParentId = ((EmployeeTask)e.ParentDataItem).Id;
            }
        }
        async Task TreeList_EditModelSaving(TreeListEditModelSavingEventArgs e) {
            if(e.IsNew)
                TreeListData.Add((EmployeeTask)e.EditModel);
            else
                e.CopyChangesToDataItem();
        }
        async Task TreeList_DataItemDeleting(TreeListDataItemDeletingEventArgs e) {
            TreeListData.Remove((EmployeeTask)e.DataItem);
        }
    }
    

    Implements

    See Also