mvc kendo 网格外列中的排序按值而不是文本排序
代码是
@Html.Kendo().Grid( _
Of cls.ProductSpecificationM).Name("Grid").Columns(
Sub(i)
i.Bound(Function(p) p.ProductSpecification_ID).Hidden(True)
i.ForeignKey(Function(p) p.Attribute_ID_FK, DirectCast(ViewBag.Attributes, System.Collections.IEnumerable), "Attribute_ID", "Attribute_Name").EditorTemplateName("_Attribute_ID_FK").Title("Name")
i.ForeignKey(Function(p) p.AttributeValue_ID_FK, DirectCast(ViewBag.AttributeValues, System.Collections.IEnumerable), "AttributeValue_ID", "AttributeValue_Name").EditorTemplateName("_AttributeValue_ID_FK").Title("Value")
i.Command(Sub(w)
w.Destroy()
End Sub)
End Sub).ToolBar(Sub(k)
k.Create() : k.Save()
End Sub).Editable(Function(e) e.Mode(GridEditMode.InCell)).Pageable(Function(i) i.Input(True).PageSizes({10, 20, 50, 100, 200, 300, 400}).Refresh(True)).Sortable().Filterable().DataSource( _
Function(p) p.Ajax().PageSize(50).Batch(True).ServerOperation(False).Model(Sub(i)
i.Id(Function(p2) p2.ProductSpecification_ID)
i.Field(Function(p2) p2.Item_ID_Fk).DefaultValue(ViewBag.Id)
i.Field(Function(p2) p2.AttributeValue_ID_FK).DefaultValue(1)
i.Field(Function(p2) p2.Attribute_ID_FK).DefaultValue(1)
End Sub) _
.Read("EditingInline_Read", "Products", New With {.id = ViewBag.Id}) _
.Update(Function(u) u.Action("EditingInline_Update", "Products")) _
.Destroy(Function(update) update.Action("EditingInline_Destroy", "Products")) _
.Create(Function(update) update.Action("EditingInline_Create", "Products"))).Events(Function(e) e.Edit("edit"))
如何按列文本排序?