5
I am developing with MVC, and I have the List view
[...]
var columns = new WebGridColumn[] {
grid.Column("Id"),
grid.Column("Descricao"),
grid.Column("UsuarioModificacao"),
grid.Column("DataModificacao"),
grid.Column("UltimoLogAcesso.DataAcesso"),
grid.Column("UltimoLogAcesso.Ip"),
grid.Column("UrlChamadaAlerta", format: (grid) => string.Format("{Id}")),
grid.Column("FlagBloqueioPainel"),
grid.ButtonColumn("ico_permission.gif", x => Url.Action("ConfirmarExclusao", "PainelChamada", new { id = x.Id } ), updateTargetId: "console"),
I need to format the column Urlchamadawarning that should be in this format
painel.ejis.com.br/?id=<PainelChamada.ID>&token=<PainelChamada.GuidPainelChamada >
I’ll use the ID
and the Guid
that are on the model Painelchamada
public int Id {get; set;}
public System.Guid Guid { get; set; }
Guys, it would be right to create routes, but for now the format will suit my purpose. Obs.: how will be used the format certain properties that would be made with the routes need not look perfect. My Format is wrong, but my difficulty is to assemble the correct expression.
grid.Column("UrlChamadaAlerta",
format: dataItem =>
string.Format("painel.ejis.com.br?id={0}&token={1}",
dataItem.Id,
dataItem.Guid),
Here’s a tip for those who need it!
That class
WebGridColumn
belongs to which package?– Leonel Sanches da Silva