c# - Asp .Net MVC Kendo grid Tag Helper,根据其文本过滤枚举
问题描述
如何添加过滤器下拉列表来选择要过滤的文本?
public enum AppointmentType : byte
{
[Display(ResourceType = typeof(Titles), Name = "OnlineVideoCall")]
VideoCall = 1
}
在视图模型上:
public string AppointmentStringType {get;set;}
public AppointmentType AppointmentType{get;set;}
在后端:
_db.Appointments.Select(r => new AppointmentViewModel(){
AppointmentStringType = r.AppointmentType.GetDisplayName(),
AppointmentType = r.AppointmentType
});
在 .cshtml 上:
<column field="@nameof(AppointmentViewModel.AppointmentType)" title="@Captions.AppointmentType" template="#= data.AppointmentStringType #" width="100"/>
解决方案
推荐阅读
- ios - 我可以重置 CFBundleShortVersionString
- php - 从两个表MySql中用0计数值
- reactjs - React Typescript - 添加自定义属性
- r - 如何将 RFE 选择的变量插入到 r 中的机器学习模型中?
- javascript - 无法停止使用 javascript 录制
- javascript - 使用 javascript 表达式返回基于文件扩展名的文件列表
- xpath - 谷歌表格中的 Importhtml 公式用于网络抓取
- javascript - 你如何使 this.forceUpdate() 应用于 React Native 中的整个应用程序?
- apache-flink - 什么是 blobstore 文件,为什么它们会不断填满 /tmp 目录?
- excel - 如何遍历包含字符串的列的行并通过电子邮件发送这些字符串?