ListViewBuilder
类的连贯接口列表视图.
方法
BindTo (System.Collections.Generic.IEnumerable)
将ListView绑定到一个对象列表
参数
数据源,System.Collections.Generic.IEnumerable < T >
数据源。
例子
@(Html.Kendo().ListView() .Name("productsListView") .BindTo((IEnumerable) ViewData["Products"]);)
BindTo (System.Collections.IEnumerable)
将ListView绑定到一个对象列表
参数
数据源,System.Collections.IEnumerable
IEnumerable对象列表。
例子
@(Html.Kendo().ListView() .Name("productsListView") .BindTo((IEnumerable)ViewData["Products"]);)
ClientTemplateId system . string) (
指定ListView项模板。
参数
templateId -系统。字符串
包含模板的元素的Id。
例子
@(Html.Kendo().DataSource() .Name("productsListView") .ClientTemplateId("listViewTemplate");)
ClientAltTemplateId system . string) (
指定ListView交替项模板。
参数
templateId -系统。字符串
包含模板的元素的Id。
例子
@(Html.Kendo().DataSource() .Name("productsListView") .ClientAltTemplateId("listViewTemplate");)
可分页()
允许数据分页。
例子
@(Html.Kendo(). listview () . name ("productsListView") . pageable (). dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
可分页(System.Action)
允许数据分页。
参数
pagerAction -系统。行动<PageableBuilder>
使用生成器定义分页设置。
例子
@(Html.Kendo(). listview () . name ("productsListView") . pageable (paging=> page . numeric (true). previousnext (true). pagesize (false)) . dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
可滚动()
如果设置为真正的
当内容超出列表视图时,列表视图将显示一个滚动条高度价值。默认情况下,滚动是禁用的。
可滚动(Kendo.Mvc.UI.ListViewScrollableMode)
在无限滚动模式下,listview应该配置为显示滚动条。滚动到滚动条的末尾将加载更多的项目(等于pageSize数字),并将它们附加到listview DOM元素,直到加载并显示所有项目。
参数
模式-ListViewScrollableMode
可滚动的值
Navigatable ()
启用键盘导航。
例子
@(Html.Kendo(). listview () . name ("productsListView") . navigatable (). dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
可选择的()
启用单个项目选择。
例子
@(Html.Kendo(). listview () . name ("productsListView") . selectable (). dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
可选择的(System.Action)
在指定的选择模式下启用选择。
参数
selectionAction - System。行动<ListViewSelectionSettingsBuilder>
使用生成器定义选择模式。
例子
@(Html.Kendo(). listview () . name ("productsListView") . selectable (select=>select. mode (ListViewSelectionMode.Multiple)) . dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
AriaLabel system . string) (
在ListView内容元素(角色为listbox或list的元素)上设置一个aria-label属性。
参数
价值——系统。字符串
ariabel的值
例子
@(Html.Kendo().ListView() .Name("productsListView") .AriaLabel("ListView with products")))
AutoBind (System.Boolean)
指定ListView是否应该在初始加载时自动绑定。这只有在使用AJAX绑定时才有可能,并且小部件最初没有在服务器上填充。
参数
价值——系统。布尔
如果为true, ListView将自动绑定数据,否则为false
TagName system . string) (
指定ListView包装器元素标签名称。
参数
tagName -系统。字符串
例子
@(Html.Kendo().ListView() .Name("productsListView") .TagName("div"))
可编辑(System.Action)
配置ListView编辑设置。
参数
configurator - System。行动<ListViewEditingSettingsBuilder>
编辑设置配置器。
例子
@(Html.Kendo(). listview () . name ("productsListView") . editable (edit => edit. enabled (true)) . dataSource (dataSource => dataSource . ajax (). model (model => model. id ("ProductID")) . read (read => read。Action("Products_Read", "ListView")) . update (update => update。Action("Products_Update", "ListView")) .PageSize(21)))
可编辑的()
配置ListView编辑设置。
例子
@(Html.Kendo(). listview () . name ("productsListView") . editable (edit => edit. enabled (true)) . dataSource (dataSource => dataSource . ajax (). model (model => model. id ("ProductID")) . read (read => read。Action("Products_Read", "ListView")) . update (update => update。Action("Products_Update", "ListView")) .PageSize(21)))
事件(System.Action)
配置客户端事件。
参数
configurator - System。行动<ListViewEventBuilder>
客户端事件操作。
例子
@(Html.Kendo().ListView() .Name("productsListView") .Events(events => events .DataBound("onDataBound"))))
数据源(System.Action)
将ListView绑定到数据源。
参数
configurator - System。行动<ListViewAjaxDataSourceBuilder>
的DataSourceBuilder配置器。
例子
@(Html.Kendo(). listview () . name ("productsListView") . dataSource (dataSource => dataSource . ajax (). read (read => read)Action("Products_Read", "ListView")) .PageSize(21)))
数据源system . string) (
将ListView绑定到现有的DataSource实例。
参数
dataSourceId -系统。字符串
客户端DataSource实例的名称。
例子
@(Html.Kendo(). dataSource () . name ("dataSource1") . ajax (dataSource => dataSource . pagesize (10) . read (read => read.)Action("Products_Read", "DataSource")))) @(Html.Kendo().ListView() .Name("productsListView") .DataSource("dataSource1"))
与(System.Boolean)
渲染listview元素周围的边框。
参数
价值——系统。布尔
border的值
边界system . string) (
渲染列表视图项周围的边框。有效值为:all:显示列表视图项周围的边框。水平:显示列表视图项目的上边框。在设置布局时有用:“flex”和flex。方向:列。或垂直:呈现列表视图项的上边框。在设置布局时有用:“flex”和flex。方向:行. .
参数
价值——系统。字符串
边框的值
system . string)布局(
指定listview内容的布局。有效的选项有:flex:这相当于display: flex。它定义了一个伸缩容器,并为它的所有直接子容器启用伸缩上下文。可以认为伸缩项主要以水平行或垂直列的形式布局。这相当于display: grid。它将元素定义为一个网格容器,并为其内容建立一个新的网格格式上下文。
参数
价值——系统。字符串
布局的值
Flex (System.Action)
Flex布局设置
参数
configurator - System。行动<ListViewFlexSettingsBuilder>
flex设置的配置器。
网格(System.Action)
网格布局设置。
参数
configurator - System。行动<ListViewGridSettingsBuilder>
网格设置的配置器。
[system . string) (
定义包含listview内容的元素类型。
参数
价值——系统。字符串
ContentElement的值
ToComponent ()
返回内部视图组件。
system . string)名称(
设置组件的名称。
参数
componentName -系统。字符串
组件的名称。
例子
@(Html.Kendo(). grid () . name ("grid") . columns (columns => {columns。bind (p => p. orderid).Filterable(false);列。Bound(p => p. freight);}) . dataSource (dataSource => dataSource . ajax () . pagesize (20) . read (read => read。操作(“Orders_Read”,“Grid”))))
延期(System.Boolean)
禁止初始化脚本呈现。注意,此选项应与Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)一起使用。
参数
递延,系统。布尔
ModelMetadata (System.Web.Mvc.ModelMetadata)
使用模型的元数据。
参数
modelMetadata -System.Web.Mvc.ModelMetadata
模型的元数据集
HtmlAttributes (System.Object)
设置HTML属性。
参数
属性- - - - - -系统。对象
HTML属性。
HtmlAttributes (System.Collections.Generic.IDictionary)
参数
属性- - - - - -System.Collections.Generic.IDictionary <字符串、对象>
呈现()
渲染组件。
例子
@ (@Page继承= " System.Web.Mvc。ViewPage>") @(Html.Kendo(). grid (Model) .Name("grid") . detailtemplate (Product =>{)产品详细信息:产品名称:@(Product。ProductName) 库存单位:@(product. name)UnitsInStock) @(}) .Render();