面向ASP的Telerik UI。NET MVC免费下载30天试用版

TileLayout调整

面向ASP的Telerik UI布局。NET MVCallows you resize the containers by snapping to the available columns and row units. When enabled the user is able to alter the width or the height of а current item.

调整大小利用了CSS网格机制,这意味着小部件增加了元素的扩展范围,而浏览器则负责在必要时如何重新排列这些项。

启用TileLayout的可调整大小功能

要启用TileLayout的可调整大小功能,请设置可调整大小的()方法和传递真正的作为参数。当启用可调整大小时,TileLayout项目应该具有行宽ColSpan定义的。

下面的例子将呈现一个两行两列的网格,可以垂直和水平调整大小。

@(Html.Kendo(). tilelayout (). name ("tilelayout") . columns (3) . containers (c => {c. add()。Header(h => h. text ("Item one"))。BodyTemplate("Item one body").ColSpan(1).RowSpan(1);c.Add()。Header(h => h. text ("Item two"))。BodyTemplate("Item two body").ColSpan(1).RowSpan(1);}) .Resizable(true))

事件处理

小部件触发调整()事件,该事件提供对调整大小的容器的访问。

.Events(e=>e. resize ("onResize"))