[!Note] Please note that this control has been deprecated and replaced with the Grid component, and as such, we recommend migrating to that control. This will not be receiving any new features, bug fixes will be deprioritized. For help or questions on migrating your codebase to the Data Grid, please contact support.

    Blazor Grid 정렬 개요

    Ignite UI for Blazor 데이터 테이블/Data Grid는 단일 열, 다중 열 및 Tri-State 열 정렬 구성을 사용하여 오름차순 및 내림차순 열 정렬을 지원합니다.

    Blazor Grid Sorting Example

    Code Snippet

    속성을 사용하여 Blazor 데이터 그리드에서 오름차순 또는 내림차순으로 HeaderClickAction 단일 또는 여러 열을 정렬할 수 있습니다. TriState를 사용하는 경우 열에 적용된 정렬을 제거할 수 있습니다.

    • SortByMultipleColumns
    • SortByMultipleColumnsTriState
    • SortByOneColumnOnly
    • SortByOneColumnOnlyTriState
    <IgbDataGrid Height="100%" Width="100%" @ref="DataGridRef"
        HeaderClickAction="HeaderClickAction.SortByMultipleColumns"
        DataSource="DataSource" />
    

    Sorting through API

    @code {
        // Using the ref property above:
        private IgbDataGrid grid;
        private IgbDataGrid DataGridRef
        {
            get { return grid; }
            set
            {
                grid = value;
                OnGridRefChanged();
                StateHasChanged();
            }
        }
    
        private void OnGridRefChanged()
        {
            if (this.DataGridRef != null)
            {
                this.DataGridRef.SortDescriptions.Add(new ColumnSortDescription()
                {
                    Field = "Property",
                    SortDirection = ListSortDirection.Descending
                });
            }
        }
    }
    

    API References

    • HeaderClickAction
    • SortByMultipleColumnsTriState
    • SortByMultipleColumns
    • SortByOneColumnOnlyTriState