Telerik Grid에서 부울을 문자열로 포맷 할 수 있습니까?MVC 텔릭 그리드 형식 열 bool에서 문자열
부울 (true/false)의 값을 문자열 (예/아니요)로 변경해야합니다.
내 모델 :
[DataMember]
[DisplayName("PANDORA")]
public bool SeVePandora { get; set; }
[DataMember]
[DisplayName("PORTOS")]
public bool SeVePortos { get; set; }
[DataMember]
[DisplayName("CARRIER")]
public bool SeVeCarrier { get; set; }
[DataMember]
[DisplayName("CALCULADORA")]
public bool SeVeCalculadora { get; set; }
[DataMember]
[DisplayName("CONTROL STOCK")]
public bool SeVeControlStock { get; set; }
[DataMember]
[DisplayName("REMARKETING")]
public bool SeVeRemarketing { get; set; }
[DataMember]
[DisplayName("AUTO CREDIT")]
public bool SeVeAutocredit { get; set; }
[DataMember]
[DisplayName("VALORES RESIDUALES")]
public bool SeVeValoresResiduales { get; set; }
[DataMember]
[DisplayName("PRUEBAS")]
public bool EntornoPruebas { get; set; }
내보기 : 람다 expresions이 허용되지 않습니다
<%= Html.Telerik().Grid<VWIS.DataModels.Models.AvisosPromociones.Avisos>()
.Name("ListAvisos")
.Columns(columna =>
{
columna.Bound(d => d.IdAViso).Visible(false).Sortable(false);
columna.Bound(d => d.Titulo).Width(380).Sortable(false);
columna.Bound(d => d.FechaInicio).Format("{0:dd/MM/yyyy}").Width(95).Sortable(true);
columna.Bound(d => d.FechaFin).Format("{0:dd/MM/yyyy}").Width(86).Sortable(true);
columna.Bound(d => d.SeVePandora).Width(50).Sortable(false);
columna.Bound(d => d.SeVePortos).Width(50).Sortable(false);
columna.Bound(d => d.EntornoPruebas).Width(50).Sortable(false);
columna.Bound(d => d.SeVeCarrier).Width(50).Sortable(false);
columna.Bound(d => d.SeVeCalculadora).Width(50).Sortable(false);
columna.Bound(d => d.SeVeControlStock).Width(50).Sortable(false);
columna.Bound(d => d.SeVeRemarketing).Width(50).Sortable(false);
columna.Bound(d => d.SeVeAutocredit).Width(50).Sortable(false);
columna.Bound(d => d.SeVeValoresResiduales).Width(50).Sortable(false);
}).DataBinding(datos => datos.Ajax().Select("_BusquedaAvisos", "Avisos", new { PrimeraBusqueda = true }))
.Pageable(page => page.PageSize(10))
.Selectable()
.Sortable()
.Reorderable(reorder => reorder.Columns(true))
.ClientEvents(e => e.OnDataBinding("OnDataBinding").OnRowSelect("SeleccionarFila"))
%>
columna.Bound(d => d.SeVePandora).Format()
에서.
나를 도와 줄 사람이 있습니까?
동일한 문제가 있고 내 코드가 작동하지 않습니다. columns.Bound (cb => cb.Status) .Width (60) .ClientTemplate ( "<# if (Status == true) { #> "+ " 활성 "+ "<#한다} else {#> "+ " 비활성 "+ "<# } #> " ); "상태가 정의되지 않았습니다."라는 JavaScript 오류가 발생합니다. 클라이언트 템플릿을 제거하면 부울 필드가 렌더링되지만 true/false가 렌더링됩니다. – SFAgitator