2
I have a DataGrid
and I’m wanting to put in a field a CheckBox
, was researching and it seems that with the .EditorOptions()
it is possible to do this, but do not know how, just passing CheckBox
as parameter, n works, and I would like this field to send S or N for selected or not selected respectively
My code:
@(Html.DevExtreme().DataGrid<CobrancaViewModel>().ID("gridContainer")
.ColumnAutoWidth(true)
.Height(200)
.Width(650)
.ShowBorders(true)
.Paging(paging => paging.Enabled(false))
.Editing(editing =>
{
editing.Mode(DevExtreme.AspNet.Mvc.GridEditMode.Row);
editing.AllowAdding(true);
editing.AllowDeleting(true);
editing.AllowUpdating(true);
})
.Columns(columns =>
{
columns.AddFor(m => m.CbaCob_carteira);
columns.AddFor(m => m.CbaCob_variacao);
columns.AddFor(m => m.CbaCob_especie);
columns.AddFor(m => m.CbaCob_EspecieDocumento);
columns.AddFor(m => m.CbaCob_Aceite);
columns.AddFor(m => m.CbaCob_Aceite); //Gostaria de adicionar a essa coluna o CheckBox
columns.AddFor(m => m.CbaCob_convenio);
columns.AddFor(m => m.CbaCob_SistemaCobranca);
columns.AddFor(m => m.CbaCob_MensagemLocalPag);
})
.DataSource(AgenciaController.ListaContatos)
.OnContentReady("pegarDadosGrid")
)
For those who did not understand: I have a grid and several fields to be filled inside the grid, and I need one of these fields to be a selection field, example in the following image :
what are the overloads of
columns.AddFor()
?– Leandro Angelo
you want to show a Checkbox or S/N ?
– Leandro Angelo
I’m sorry, but I can’t answer that question
– Jeff Henrique
I want to show the Checkbox
– Jeff Henrique
when you write
columns.AddFor(m => m.CbaCob_Aceite
and adds a,
it presents other constructors with more parameters?– Leandro Angelo
Yes, I can even write Checkbox() But he says it’s not valid in context
– Jeff Henrique