我在内联GridEditMode和GridInsertRowPosition中使用kendo网格设置为bottom.Ajax用于数据绑定.排序已启用并按DateTime字段排序.页面大小设置为10.
当有多个页面(超过10个记录)时会出现问题.我有一个javascript函数跳转到最后一页并在底部显示新行.但是在某些点触发了排序事件,并且网格移动到只读模式.
是否有可能仅在添加新行时阻止网格排序?
欢迎任何帮助.谢谢!
我想在KendoUi网格中使用EditorTemplateName作为外键.
当网格编辑模式为InLine时,一切正常,我的模板已加载.但当更改模式为Popup时不加载模板.怎么解决呢?
@(Html.Kendo().Grid<Product>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.ProductId).Visible(false);
columns.Bound(p => p.Title);
columns.ForeignKey(p => p.CategoryId, new SelectList(ViewBag.CategoryySelectList, "Value", "Text"))
.EditorTemplateName("MyTemplate");
columns.Command(cmd => cmd.Edit());
})
.Editable(edit => edit
.Mode(GridEditMode.PopUp)
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(15)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.ProductId);
})
.Read(read => read.Action("FillGrid", "Products"))
.Update(update => update.Action("Edit", "Products"))
.Destroy(destroy => destroy.Action("Delete", "Products"))
)
)
Run Code Online (Sandbox Code Playgroud) asp.net-mvc kendo-ui kendo-grid kendo-combobox kendo-asp.net-mvc
根据要求,我在我的VIEW上有一个Kendo UI网格.但是很遗憾,读取功能没有在控制器中被击中.这很烦人,我遇到了同样的问题,即使每个人看起来都像文件一样在http://demos.kendoui.com/web/grid/index.html上提供.这是我的查看代码:
@(Html.Kendo().Grid<StudentManagement_Models.Student>()
.Name("studentsGrid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Groupable(false);
columns.Bound(p => p.FirstName);
columns.Bound(p => p.MiddleName);
columns.Bound(p => p.LastName);
columns.Bound(p => p.CGPA);
})
.AutoBind(true)
.Pageable()
.Navigatable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetAllStudents", "Student"))
)
)
Run Code Online (Sandbox Code Playgroud)
这是我的控制器动作:
public ActionResult GetAllStudents([DataSourceRequest] DataSourceRequest request)
{
//Thread.Sleep(2000);
StudentManagement_Models.Student student = new StudentManagement_Models.Student();
StudentHelper helper = new StudentHelper();
student.SavedStudents = helper.GetAllStudents();
return Json(student.SavedStudents.ToDataSourceResult(request));
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?我错过了什么吗?请提出建议.
提前致谢.
现在我写了三次这个活动:

我在视图页面中有3个网格,我在每个网格上使用数据绑定.Events(events => events.DataBound("onDataBound"),我可以在数据绑定事件上传递参数.

我正在使用带有ajax绑定的Kendo DropdownList.
使用这些代码,我无法设置来自model的初始值.它只是用项目填充列表并选择第一项.
@(Html.Kendo().DropDownList()
.Name("NATIONALITY")
.DataTextField("DESCRIPTION").HtmlAttributes(new { style = "width:220px" })
.DataValueField("REFERENCEID")
.Value(Model.NATIONALITY)
//Placeholder("SELECT")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDefinitionDetails", "Definition", new { definitionCode = "NATIONALITY", addEmptyRow = false });
}).ServerFiltering(true);
}).ServerFiltering(true);
}))
Run Code Online (Sandbox Code Playgroud)
但是当我将Html.Kendo().DropDownList()更改为Html.Kendo().Combobox()时,它还会填充列表并按预期设置初始值(这是模型传递的值).
我在ASP.NET MVC 4中遇到Kendo UI服务器包装器的一个问题如果我使用.ASPX默认视图它理解
<%: Html.Kendo().Grid() %>
Run Code Online (Sandbox Code Playgroud)
但同时如果我尝试添加Razor视图它不明白
@(Html.Kendo() ) systax.
Run Code Online (Sandbox Code Playgroud)
我也在web.config中输入
<namespaces>
<add namespace="Kendo.Mvc.UI" />
<httpHandlers>
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
</httpHandlers>
<handlers>
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
Run Code Online (Sandbox Code Playgroud)
Pl告诉我我必须失踪的地方和地点
感谢致敬,
阿米特
我想在分组标题中使用另一列(而不是分组列)中的聚合值.例如,以下是来自Kendo的演示:
http://demos.telerik.com/kendo-ui/grid/aggregates
它汇总了库存单位的单位.我想在分组标题中显示Average 14(除了Count:5).可能吗?

我试图在标题中使用模板,
groupHeaderTemplate: "Units In Stock: #=value# (#=getAverage(data)# / #=count#)"
Run Code Online (Sandbox Code Playgroud)
然后在getAverage()中,我根据数据计算了值.
var aggregates = ds.aggregates();
var averaged = aggregates.UnitsOnOrder.average;
Run Code Online (Sandbox Code Playgroud)
但是,平均值是所有行的平均值,而不是组中的数据.
有什么建议?
谢谢
我正在将Kendo网格用于MVC 4.0。我有最新的DLL 2015.1.318.440。我包括在内jszip.js。我复制并粘贴了示例中的代码:
.ToolBar(tools => tools.Excel())
.Excel(excel => excel.FileName("Enrollments.xlsx"))
Run Code Online (Sandbox Code Playgroud)
它什么也没做。该按钮将更改颜色,仅此而已。尝试时没有任何错误。它什么也没做。我没有使用代理服务器。我正在Chrome最新版本中运行它。
网格
@(Html.Kendo().Grid<Trawick.Agents.Models.EnrollmentPolicy>()
.Name("grid")
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Enrollments.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Enrollments"))
)
.Columns(columns =>
{
columns.Bound(p => p.enrollment_date)
})
.Pageable()
.Groupable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Enrollments_Read", "Enrollments")))
)
Run Code Online (Sandbox Code Playgroud)
控制器
[HttpPost]
public ActionResult Excel_Export_Save(string contentType, string base64, string fileName)
{
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}
public ActionResult Enrollments_Read([DataSourceRequest]DataSourceRequest request, int? id)
{
string sql = "SELECT * FROM …Run Code Online (Sandbox Code Playgroud) 我在ASP.NET MVC Kendo UI上使用服务器端验证.在这样的文本字段的视图(用于创建)上:
@Html.Kendo().TextBoxFor(model => model.CompanyTypeName).Name("CompanyTypeName")
Run Code Online (Sandbox Code Playgroud)
我需要改变文本框的大小.我试过这样的:
@Html.Kendo().TextBoxFor(model => model.CompanyTypeName, new { style = "width:50px", @maxlength = "5" }).Name("CompanyTypeName")
Run Code Online (Sandbox Code Playgroud)
但是不起作用.谢谢你.
如何在Kendo UI Grid中显示行号?我的代码不起作用.页面显示列但它是空的.
@{int counter = 1;}
@(Html.Kendo().Grid<QueueViewModel>()
.Name("Queue")
.Columns(columns =>
{
columns.Template(@<text><span>@counter @{ counter++; }</span></text>).Title("#");
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("GetOpenQueue", "DataSource", new { GeneralQueue = true })
))
Run Code Online (Sandbox Code Playgroud)