Blazor的Telerik UI?下载30天免费试用

冻结的列

树列表允许您冻结一个或多个列。这将允许用户在树列表中水平滚动,但仍然能够始终保持一些重要的列可见(例如ID或命令列)。

要启用列冻结,请设置锁着的列的参数真正的

如果要冻结的列不是列表中的第一列,则树列表必须是可滚动的。这要求有足够的列宽度设置使树列表具有水平滚动条(列的Width之和超过树列表的Width)。控件中有关树列表滚动行为的详细信息TreeList列宽度行为篇文章。

在树列表的开始、中间和结尾冻结列

TreeList冻结列行为

@*探索锁定(冻结)列在滚动时的行为。为简便起见,编辑未实现*@        Edit    @code {public List Data {get;设置;} protected override async任务OnInitializedAsync(){数据=等待GetTreeListData();} //样本模型公共类Employee{公共int Id {get;设置;}公共int?ParentId {get; set; } public string Name { get; set; } public string EmailAddress { get; set; } public DateTime HireDate { get; set; } } // data generation async Task> GetTreeListData() { List data = new List(); for (int i = 1; i < 15; i++) { data.Add(new Employee { Id = i, ParentId = null, Name = $"root: {i}", EmailAddress = $"{i}@example.com", HireDate = DateTime.Now.AddYears(-i) }); ; for (int j = 1; j < 4; j++) { int currId = i * 100 + j; data.Add(new Employee { Id = currId, ParentId = i, Name = $"first level child {j} of {i}", EmailAddress = $"{currId}@example.com", HireDate = DateTime.Now.AddDays(-currId) }); for (int k = 1; k < 3; k++) { int nestedId = currId * 1000 + k; data.Add(new Employee { Id = nestedId, ParentId = currId, Name = $"second level child {k} of {i} and {currId}", EmailAddress = $"{nestedId}@example.com", HireDate = DateTime.Now.AddMinutes(-nestedId) }); ; } } } return await Task.FromResult(data); } }

另请参阅

在本文中
Baidu
map